Skip to content

3.12.18

3.12.18 #77

Workflow file for this run

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