-
Notifications
You must be signed in to change notification settings - Fork 152
61 lines (54 loc) · 1.65 KB
/
github-action-build-and-release.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
name: build-release
run-name: Build And Release Tabby
on:
push:
tags:
- 'v*'
jobs:
build_release:
runs-on: ubuntu-latest
name: build_release
steps:
- name: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
- name: Build
run: |
./gradlew bootJar
echo "artifactPath=$(pwd)" >> $GITHUB_ENV
version=$(cat VERSION)
tag=${GITHUB_REF_NAME}
echo "version=$version" >> $GITHUB_ENV
echo "tag=$tag" >> $GITHUB_ENV
cp build/libs/tabby.jar .
zip -r tabby.zip . -x "build/*" ".github/*" "cyphers/*" ".git/*" "doc/*" "gradle/*" "src/*" ".gitignore" "README.md" "*gradle*"
rm tabby.jar
# debug
- run: echo version is ${{ env.version }}
- run: echo tag is ${{ env.tag }}
- name: release
uses: actions/create-release@v1
id: create_release
with:
draft: false
prerelease: false
release_name: ${{ env.tag }}
tag_name: ${{ env.tag }}
body: RELEASE:${{ env.version }}. Generated By Github Actions.
env:
GITHUB_TOKEN: ${{ github.token }}
- name: upload release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ env.artifactPath }}/tabby.zip
asset_name: tabby.zip
asset_content_type: application/zip