0.3.1 - fix workflow #32
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Gradle Package | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: windows-latest | |
permissions: | |
contents: write | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up GraalVM 21 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '21' | |
distribution: 'graalvm' | |
server-id: github | |
settings-path: ${{ github.workspace }} | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
- name: Display build.gradle.kts | |
run: cat build.gradle.kts | |
- name: Get version and create Git Tag | |
id: get_version | |
run: | | |
$version = .\gradlew.bat properties | Select-String -Pattern 'version:' | ForEach-Object { $_ -replace 'version: ', '' } | |
echo "Extracted version: $version" | |
$tag = "v$version" | |
echo "TAG is set to: $tag" | |
echo "::set-output name=tag::$tag" | |
echo "::set-output name=version::$version" | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git tag $tag | |
git push https://x-access-token:${{ secrets.TOKEN }}@github.com/${{ github.repository }} $tag | |
- name: Package with jpackage | |
run: .\gradlew.bat jpackage | |
- name: Create Release | |
id: create_release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ steps.get_version.outputs.tag }} | |
name: "Release ${{ steps.get_version.outputs.version }}" | |
draft: false | |
prerelease: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.TOKEN }} | |
- name: Upload installer files | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ steps.get_version.outputs.tag }} | |
files: | | |
build/installer/M5Client-*.exe | |
env: | |
GITHUB_TOKEN: ${{ secrets.TOKEN }} |