diff --git a/.github/workflows/build-artifact.yml b/.github/workflows/build-artifact.yml index 51f31ed8..2abf054f 100644 --- a/.github/workflows/build-artifact.yml +++ b/.github/workflows/build-artifact.yml @@ -1,5 +1,9 @@ name: build-artifact -on: push +on: + push: + tags-ignore: * +env: + commithash: "" jobs: build-matrix: runs-on: windows-2022 @@ -14,13 +18,13 @@ jobs: - name: Build program shell: cmd run: | - for /f "tokens=*" %%a in ('git describe --tags') do (set commithash=%%a) + for /f "tokens=*" %%a in ('git describe --tags') do (set ${{ env.commithash }}=%%a) call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsamd64_x86.bat" call msbuild -m:5 -nologo -p:Configuration="${{ matrix.configuration }}" -p:Platform="${{ matrix.platform }}" if %ERRORLEVEL%==1 exit %ERRORLEVEL% - call release.bat ${{ matrix.configuration }} ${{ matrix.platform }} %commithash%_%GITHUB_RUN_ID% + call release.bat ${{ matrix.configuration }} ${{ matrix.platform }} ${{ env.commithash }}_${{ github.run_id }} - name: Upload binaries uses: actions/upload-artifact@master with: - name: Dn-FamiTracker_${{ matrix.platform }}_${{ matrix.configuration }} + name: Dn-FamiTracker_${{ env.commithash }}_${{ github.run_id }}_${{ matrix.platform }}_${{ matrix.configuration }} path: distribute/*_${{ matrix.platform }}_${{ matrix.configuration }}.7z diff --git a/.github/workflows/build-release-artifact.yml b/.github/workflows/build-release-artifact.yml index 2ad84ec6..509e0e8f 100644 --- a/.github/workflows/build-release-artifact.yml +++ b/.github/workflows/build-release-artifact.yml @@ -1,25 +1,43 @@ name: build-artifact-publish on: - release: - types: [published] + push: + tags: + - "*" jobs: build-matrix-publish: runs-on: windows-2022 strategy: matrix: platform: [x64, Win32] - configuration: [Release, Debug] + # configuration is Release only steps: - uses: actions/checkout@master - name: Build program shell: cmd run: | call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsamd64_x86.bat" - call msbuild -m:5 -nologo -p:Configuration="${{ matrix.configuration }}" -p:Platform="${{ matrix.platform }}" + call msbuild -m:5 -nologo -p:Configuration="Release" -p:Platform="${{ matrix.platform }}" if %ERRORLEVEL%==1 exit %ERRORLEVEL% - call release.bat ${{ matrix.configuration }} ${{ matrix.platform }} + call release.bat Release ${{ matrix.platform }} - name: Upload binaries uses: actions/upload-artifact@master with: - name: Dn-FamiTracker_${{ matrix.platform }}_${{ matrix.configuration }} - path: distribute/*_${{ matrix.platform }}_${{ matrix.configuration }}.7z + path: distribute/*_${{ matrix.platform }}_Release.7z + publish-build: + needs: build-matrix-publish + runs-on: windows-2022 + steps: + - uses: actions/download-artifact@master + with: + path: distribute + - name: Download binaries + shell: powershell + run: ls -R + - name: Upload release + uses: marvinpinto/action-automatic-releases@master + with: + repo_token: "${{ secrets.GITHUB_TOKEN }}" + draft: true + prerelease: false + automatic_release_tag: draft + files: distribute/*.7z