From 79eddde155f5125f94db25bbd1b0e1882a3eebd3 Mon Sep 17 00:00:00 2001 From: OMGeeky <> Date: Thu, 2 Oct 2025 16:46:08 +0200 Subject: [PATCH 1/5] handle errors during nsis exe creation and only upload zip in those cases --- .github/workflows/release.yml | 94 ++++++++++++++++++++--------------- 1 file changed, 53 insertions(+), 41 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f7481d2..6c67dee 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,55 +2,67 @@ name: Release Build on: release: - types: [created] + types: [ created ] + workflow_dispatch: jobs: build: runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v2 - - name: Get Version - id: get_version - shell: bash - run: | - echo "Reading version from file:" - cat res/ATCS_latest - echo "" - VERSION=$(tr -d '[:space:]' < "res/ATCS_latest") - echo "Processed version: $VERSION" - echo "VERSION=$VERSION" >> $GITHUB_ENV - echo "Environment variable set to: $VERSION" + - name: Get Version + id: get_version + shell: bash + run: | + echo "Reading version from file:" + cat res/ATCS_latest + echo "" + VERSION=$(tr -d '[:space:]' < "res/ATCS_latest") + echo "Processed version: $VERSION" + echo "VERSION=$VERSION" >> $GITHUB_ENV + echo "Environment variable set to: $VERSION" - - name: Set up JDK - uses: actions/setup-java@v2 - with: - java-version: '11' - distribution: 'temurin' + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: '11' + distribution: 'temurin' - - name: Build JAR - shell: bash - run: | - cd packaging - chmod +x package.sh - echo "Building JAR and ZIP for version: ${{ env.VERSION }}" - ./package.sh -windows - echo "Created artifacts:" - ls -la common/ATCS.jar - ls -la ATCS_${{ env.VERSION }}.zip + - name: Build JAR + shell: bash + run: | + cd packaging + chmod +x package.sh + echo "Building JAR and ZIP for version: ${{ env.VERSION }}" + ./package.sh -windows + echo "Created artifacts:" + ls -la common/ATCS.jar + ls -la ATCS_${{ env.VERSION }}.zip - - name: Install NSIS - uses: joncloud/makensis-action@v4 - with: - script-file: packaging/Windows/ATCS_Installer.nsi - arguments: /DVERSION="${{ env.VERSION }}" + - name: Install NSIS + uses: joncloud/makensis-action@v4 + with: + script-file: packaging/Windows/ATCS_Installer.nsi + arguments: /DVERSION="${{ env.VERSION }}" + continue-on-error: true - - name: Upload Release Assets - uses: softprops/action-gh-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - files: | - ./packaging/ATCS_${{ env.VERSION }}.zip - ./packaging/ATCS_${{ env.VERSION }}_Setup.exe + - name: Determine Upload Files + id: upload_files + shell: bash + run: | + FILES="./packaging/ATCS_${VERSION}.zip" + if [ -f "./packaging/ATCS_${VERSION}_Setup.exe" ]; then + FILES="$FILES ./packaging/ATCS_${VERSION}_Setup.exe" + else + run: echo "::warning::exe-installer created by NSIS was not found; only ZIP will be uploaded." + fi + echo "files=$FILES" >> $GITHUB_OUTPUT + + - name: Upload Release Assets + uses: softprops/action-gh-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + files: ${{ steps.upload_files.outputs.files }} From 5f2927e00c406dcc5e1c3a68c9ac01f5b6ffadbc Mon Sep 17 00:00:00 2001 From: OMGeeky <> Date: Thu, 2 Oct 2025 16:59:48 +0200 Subject: [PATCH 2/5] switch to linux runner (windows-latest is annoying me with undocumented breaking changes...) --- .github/workflows/release.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6c67dee..074c407 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,7 +7,7 @@ on: jobs: build: - runs-on: windows-latest + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -36,12 +36,16 @@ jobs: cd packaging chmod +x package.sh echo "Building JAR and ZIP for version: ${{ env.VERSION }}" - ./package.sh -windows + ./package.sh echo "Created artifacts:" ls -la common/ATCS.jar ls -la ATCS_${{ env.VERSION }}.zip - - name: Install NSIS + - name: 'Install makensis (apt)' + run: sudo apt update && sudo apt install -y nsis nsis-pluginapi + continue-on-error: true + + - name: Create Windows-Installer with NSIS uses: joncloud/makensis-action@v4 with: script-file: packaging/Windows/ATCS_Installer.nsi @@ -49,7 +53,7 @@ jobs: continue-on-error: true - name: Determine Upload Files - id: upload_files + id: check_files_to_upload shell: bash run: | FILES="./packaging/ATCS_${VERSION}.zip" @@ -65,4 +69,4 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - files: ${{ steps.upload_files.outputs.files }} + files: ${{ steps.check_files_to_upload.outputs.files }} From 4293095e8e5258383de670df8970408136de435d Mon Sep 17 00:00:00 2001 From: OMGeeky <> Date: Thu, 2 Oct 2025 17:09:08 +0200 Subject: [PATCH 3/5] fix warning/error output in action --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 074c407..efbbaa0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -60,7 +60,7 @@ jobs: if [ -f "./packaging/ATCS_${VERSION}_Setup.exe" ]; then FILES="$FILES ./packaging/ATCS_${VERSION}_Setup.exe" else - run: echo "::warning::exe-installer created by NSIS was not found; only ZIP will be uploaded." + echo "::error::exe-installer created by NSIS was not found; only ZIP will be uploaded." fi echo "files=$FILES" >> $GITHUB_OUTPUT From 1b643f4aa13464feea3d89fd661ad0f7cf19aae5 Mon Sep 17 00:00:00 2001 From: OMGeeky <> Date: Thu, 2 Oct 2025 17:10:23 +0200 Subject: [PATCH 4/5] fix nsis arguments (from switching to linux) --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index efbbaa0..c6c6d6d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -49,7 +49,7 @@ jobs: uses: joncloud/makensis-action@v4 with: script-file: packaging/Windows/ATCS_Installer.nsi - arguments: /DVERSION="${{ env.VERSION }}" + arguments: -DVERSION="${{ env.VERSION }}" continue-on-error: true - name: Determine Upload Files From 8399ae60ee3f6330c8dba3ae901fb6558855f130 Mon Sep 17 00:00:00 2001 From: OMGeeky <> Date: Thu, 2 Oct 2025 17:40:00 +0200 Subject: [PATCH 5/5] upload zip as soon as its ready and upload exe later --- .github/workflows/release.yml | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c6c6d6d..ee7ce41 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,6 +41,14 @@ jobs: ls -la common/ATCS.jar ls -la ATCS_${{ env.VERSION }}.zip + - name: Upload Release Assets (zip) + uses: softprops/action-gh-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + files: | + ./packaging/ATCS_${{ env.VERSION }}.zip + - name: 'Install makensis (apt)' run: sudo apt update && sudo apt install -y nsis nsis-pluginapi continue-on-error: true @@ -52,21 +60,10 @@ jobs: arguments: -DVERSION="${{ env.VERSION }}" continue-on-error: true - - name: Determine Upload Files - id: check_files_to_upload - shell: bash - run: | - FILES="./packaging/ATCS_${VERSION}.zip" - if [ -f "./packaging/ATCS_${VERSION}_Setup.exe" ]; then - FILES="$FILES ./packaging/ATCS_${VERSION}_Setup.exe" - else - echo "::error::exe-installer created by NSIS was not found; only ZIP will be uploaded." - fi - echo "files=$FILES" >> $GITHUB_OUTPUT - - - name: Upload Release Assets + - name: Upload Release Assets (exe) uses: softprops/action-gh-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - files: ${{ steps.check_files_to_upload.outputs.files }} + files: ./packaging/ATCS_${{ env.VERSION }}_Setup.exe + continue-on-error: true