Workflow file for this run
This file contains hidden or 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
| # SPDX-FileCopyrightText: 2026 Project516 <138796702+Project516@users.noreply.github.com> | |
| # | |
| # SPDX-License-Identifier: GPL-3.0-or-later | |
| name: Build and Upload Release Assets | |
| on: | |
| release: | |
| types: [created] | |
| jobs: | |
| build-assets: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| target: | |
| - name: jar | |
| command: ./gradlew build && cp app/build/libs/app-all.jar NumberGuessingGame.jar | |
| artifact: NumberGuessingGame.jar | |
| path: ./NumberGuessingGame.jar | |
| - name: deb | |
| command: ./package-deb.sh | |
| artifact: NumberGuessingGame.deb | |
| path: ./NumberGuessingGame.deb | |
| - name: rpm | |
| command: ./package-rpm.sh | |
| artifact: NumberGuessingGame.rpm | |
| path: ./NumberGuessingGame.rpm | |
| needsRpmTools: true | |
| - name: zip | |
| command: ./package-zip.sh | |
| artifact: NumberGuessingGame-archive.zip | |
| path: ./NumberGuessingGame-archive.zip | |
| - name: windows | |
| command: ./package-win.sh | |
| artifact: NumberGuessingGame-windows.zip | |
| path: ./NumberGuessingGame-windows.zip | |
| - name: macos | |
| command: ./package-macos.sh | |
| artifact: NumberGuessingGame-macos.zip | |
| path: ./NumberGuessingGame-macos.zip | |
| - name: linux | |
| command: ./package-linux.sh | |
| artifact: NumberGuessingGame-linux.tar.xz | |
| path: ./NumberGuessingGame-linux.tar.xz | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up JDK 25 | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: '25' | |
| distribution: 'temurin' | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v5 | |
| - name: Install RPM build tools | |
| if: ${{ matrix.target.needsRpmTools }} | |
| run: sudo apt-get update && sudo apt-get install -y rpm | |
| - name: Build ${{ matrix.target.name }} | |
| run: ${{ matrix.target.command }} | |
| - name: Upload ${{ matrix.target.name }} artifact | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: ${{ matrix.target.artifact }} | |
| path: ${{ matrix.target.path }} | |
| if-no-files-found: error | |
| create-release: | |
| runs-on: ubuntu-latest | |
| needs: build-assets | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v7 | |
| with: | |
| path: dist | |
| - name: Upload release assets | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| dist/NumberGuessingGame.jar/NumberGuessingGame.jar | |
| dist/NumberGuessingGame.deb/NumberGuessingGame.deb | |
| dist/NumberGuessingGame.rpm/NumberGuessingGame.rpm | |
| dist/NumberGuessingGame-archive.zip/NumberGuessingGame-archive.zip | |
| dist/NumberGuessingGame-windows.zip/NumberGuessingGame-windows.zip | |
| dist/NumberGuessingGame-macos.zip/NumberGuessingGame-macos.zip | |
| dist/NumberGuessingGame-linux.tar.xz/NumberGuessingGame-linux.tar.xz |