launch4j #3
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: Build Workflow | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v2 | |
with: | |
distribution: 'adopt' | |
java-version: '17' | |
- name: Build with Maven | |
run: mvn package | |
- name: Install Chocolatey | |
run: | | |
Set-ExecutionPolicy Bypass -Scope Process -Force; | |
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; | |
iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) | |
- name: Install Launch4j using Chocolatey | |
run: | | |
choco install launch4j -y | |
- name: Create EXE using Launch4j | |
run: | | |
launch4j launch4j.xml | |
shell: bash | |
- name: Upload EXE artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: MDCstudentSIMULATOR_executable | |
path: target/MDCstudentSIMULATOR.exe | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref_name }} | |
release_name: "Release ${{ github.ref_name }}" | |
body: "Release created by GitHub Actions" | |
draft: false | |
prerelease: false | |
- name: Upload Release Asset | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: target/MDCstudentSIMULATOR.exe | |
asset_name: MDCstudentSIMULATOR.exe | |
asset_content_type: application/octet-stream |