-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (57 loc) · 2.2 KB
/
release-cli-artifact.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: 📦 package release artifacts
on:
workflow_dispatch:
push:
tags:
- 'sift-*'
jobs:
build:
name: release CLI artifacts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: setup jdk
uses: graalvm/setup-graalvm@v1
with:
version: 'latest'
java-version: '17.0.7'
distribution: 'graalvm-community'
github-token: ${{ secrets.GITHUB_TOKEN }}
cache: 'maven'
- name: build sift cli
run: mvn -B clean package -P native-image -Dmaven.test.skip=true
- name: package sift for jvm
run: |
export RELEASE_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
mkdir sift-${RELEASE_VERSION}-jvm
cp cli/target/sift-cli.jar sift-${RELEASE_VERSION}-jvm
cp sift.sh sift.zsh README.md sift-${RELEASE_VERSION}-jvm
cp release-scripts/install.sh sift-${RELEASE_VERSION}-jvm
tar -czvf sift-jvm.tar.gz sift-${RELEASE_VERSION}-jvm
- name: package native sift for linux
run: |
export RELEASE_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
mkdir sift-${RELEASE_VERSION}-linux-amd64
cp cli/target/sift sift-${RELEASE_VERSION}-linux-amd64
cp cli/target/sift-cli.jar sift-${RELEASE_VERSION}-linux-amd64
cp sift.sh sift.zsh README.md sift-${RELEASE_VERSION}-linux-amd64
cp release-scripts/install.sh sift-${RELEASE_VERSION}-linux-amd64
tar -czvf sift-linux-amd64.tar.gz sift-${RELEASE_VERSION}-linux-amd64
- name: upload artifacts
uses: softprops/action-gh-release@v1
with:
files: |
sift-linux-amd64.tar.gz
sift-jvm.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: merge ${{ github.ref_name }} to main
env:
RELEASE_VERSION: ${{ github.ref_name }}
run: |
git config user.name github-actions
git config user.email [email protected]
git fetch --all
git checkout -t origin/main
git merge ${RELEASE_VERSION}
git push