Build and Release #9
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
| name: Build and Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| build-artifacts: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK | |
| uses: actions/setup-java@v3 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| - name: Set up Gradle | |
| uses: gradle/gradle-build-action@v2 | |
| - name: Build JAR and WAR | |
| run: ./gradlew build shadowJar | |
| - name: Upload artifacts (.jar and .war) | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: jars-and-wars | |
| path: | | |
| build/libs/*.jar | |
| build/libs/*.war | |
| - name: Create GitHub Release with JAR/WAR files | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: | | |
| build/libs/*.jar | |
| build/libs/*.war | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| build-exe: | |
| runs-on: windows-latest | |
| needs: build-artifacts | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK | |
| uses: actions/setup-java@v3 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| - name: Download and extract WiX Toolset 3.11 | |
| run: | | |
| Invoke-WebRequest -Uri https://github.com/wixtoolset/wix3/releases/download/wix3111rtm/wix311-binaries.zip -OutFile wix.zip | |
| Expand-Archive wix.zip -DestinationPath "$env:ProgramFiles\wix" | |
| echo "$env:ProgramFiles\wix" | Out-File -Append -Encoding ascii $env:GITHUB_PATH | |
| shell: pwsh | |
| - name: Set up Gradle | |
| uses: gradle/gradle-build-action@v2 | |
| - name: Run createEXE task | |
| run: ./gradlew createEXE | |
| - name: Upload EXE Installer | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows-installer | |
| path: build/**/*.exe | |
| - name: Add EXE to GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: build/**/*.exe | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |