-
Notifications
You must be signed in to change notification settings - Fork 4
63 lines (56 loc) · 2.36 KB
/
release.yml
File metadata and controls
63 lines (56 loc) · 2.36 KB
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
on:
push:
branches:
- master
name: Release Interface
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
- name: Download JREs
run: |
chmod +x ./gradlew
./gradlew --stacktrace --info downloadAndExtractJREs
chmod -R 777 build/jre
- name: Run Gradle Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
./gradlew --stacktrace --info packageApp
- name: Get Env
run: |
echo "REPO_NAME=${{ github.repository }}" >> $GITHUB_ENV
echo "REPO_BASENAME=$(basename ${{ github.repository }})" >> $GITHUB_ENV
- name: New tag
id: new-tag
run: |
LATEST_RELEASE_INFO=$(curl -s https://api.github.com/repos/${{ env.REPO_NAME }}/releases/latest)
NEW_VERSION_LINK=$(echo "$LATEST_RELEASE_INFO" | grep "browser_download_url.*${{ env.REPO_BASENAME }}*" | cut -d: -f2,3 | tr -d \")
NEW_VERSION=$( echo "${NEW_VERSION_LINK}" | cut -d/ -f9)
NEW_VERSION_NO_EXT=$( echo ${NEW_VERSION} | cut -d. -f1)
NEW_VERSION_NAME=$(echo "$LATEST_RELEASE_INFO" | grep "name.*${{ env.REPO_BASENAME }}*" | cut -d: -f2,3 | tr -d \" | head -n 1 | tr -d \,)
GET_TAG=$(echo "$NEW_VERSION_NAME" | cut -d " " -f3)
TAG_1=$(echo "$GET_TAG" | cut -d. -f1)
TAG_2=$(echo "$GET_TAG" | cut -d. -f2)
TAG_3=$(echo "$GET_TAG" | cut -d. -f3)
NEW_TAG=$(echo "$(( $TAG_3 + 1 ))")
TAG="${TAG_1}.${TAG_2}.${NEW_TAG}"
echo "tag=$TAG" >> $GITHUB_OUTPUT
- name: Create GitHub Release
id: create_release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.new-tag.outputs.tag }}
name: ${{ env.REPO_BASENAME }} ${{ steps.new-tag.outputs.tag }}
token: ${{ secrets.GITHUB_TOKEN }}
commit: "master"
prerelease: true
draft: false
artifacts: "./build/distributions/InterAACtionBox_Interface-linux.tar.gz,./build/distributions/InterAACtionBox_Interface-noJRE.tar.gz,./build/distributions/InterAACtionBox_Interface-noJRE.zip,./build/distributions/InterAACtionBox_Interface-windows.zip"