diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..38f5100 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,61 @@ +name: Release Build + +on: + release: + types: [created] + +jobs: + build: + runs-on: windows-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: '11' + distribution: 'adopt' + + - name: Install NSIS + uses: joncloud/makensis-action@v4 + + - name: Build JAR + shell: bash + run: | + cd ATCS/packaging + chmod +x package.sh + ./package.sh -windows + + - name: Create Installer + shell: bash + run: | + cd ATCS/packaging/Windows + makensis ATCS_Installer.nsi + + - name: Get Version + id: get_version + shell: bash + run: | + VERSION=$(cat ATCS/packaging/ATCS_latest | sed 's/^v//') + echo "VERSION=$VERSION" >> $GITHUB_ENV + + - name: Upload ZIP to Release + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ./ATCS/packaging/ATCS_${{ env.VERSION }}.zip + asset_name: ATCS_${{ env.VERSION }}.zip + asset_content_type: application/zip + + - name: Upload Installer to Release + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ./ATCS/packaging/Windows/ATCS_v${{ env.VERSION }}_Setup.exe + asset_name: ATCS_v${{ env.VERSION }}_Setup.exe + asset_content_type: application/octet-stream