-
Notifications
You must be signed in to change notification settings - Fork 9
53 lines (51 loc) · 1.7 KB
/
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
name: Releases
on:
release:
types:
- published
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Extract release version
run: echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 21
- name: Set executable flag on gradlew
run: chmod +x gradlew
- name: Execute tests
env:
GH_PACKAGES_READ_TOKEN: ${{ secrets.PACKAGES_READ_TOKEN }}
run: ./gradlew test -Prelease.version=$RELEASE_VERSION
- name: Set version
run: echo $RELEASE_VERSION > manami-app/src/main/resources/manami.version
- name: Build executable fatJar
env:
GH_PACKAGES_READ_TOKEN: ${{ secrets.PACKAGES_READ_TOKEN }}
run: ./gradlew shadowJar -Prelease.version=$RELEASE_VERSION
- name: Upload file to release
uses: softprops/action-gh-release@v2
with:
files: manami-gui/build/libs/manami.jar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- id: fetch-latest-release
name: Fetch latest release tag
run: |
version=$(git tag --sort=creatordate | tail -2 | head -1)
echo "PREVIOUS_VERSION=$version" >> $GITHUB_OUTPUT
- name: Delete outdated release assets
uses: mknejp/delete-release-assets@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.fetch-latest-release.outputs.PREVIOUS_VERSION }}
assets: manami.jar
fail-if-no-release: false
fail-if-no-assets: false