Update release.yaml #66
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: Release | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| env: | |
| UNP4K_VERSION: 3.13.${{ github.run_number }} | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Nuget | |
| uses: nuget/setup-nuget@v2 | |
| with: | |
| nuget-version: '5.x' | |
| - name: Setup MSBuild | |
| id: setup_msbuild | |
| uses: microsoft/setup-msbuild@v2 | |
| - name: Restore dependencies | |
| run: nuget restore | |
| - name: Build | |
| run: msbuild unp4k.sln /m /verbosity:minimal /p:Configuration=Release | |
| - name: Package | |
| shell: cmd | |
| run: | | |
| cd src | |
| copy unp4k\bin\Release\net47\win-x64\unp4k.exe unp4k.gui\bin\Release\unp4k.exe | |
| erase *.pdb /s | |
| erase *.exe.config /s | |
| erase *.xml /s | |
| erase System.Net.Http.dll /s | |
| erase System.Runtime.dll /s | |
| erase System.IO.dll /s | |
| erase System.Security.*.dll /s | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: unp4k-suite-v${{ env.UNP4K_VERSION }} | |
| path: src/unp4k.gui/bin/Release | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: unforge-v${{ env.UNP4K_VERSION }} | |
| path: src/unforge/bin/Release/net481 | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: unp4k-v${{ env.UNP4K_VERSION }} | |
| path: src/unp4k/bin/Release/net481 | |
| release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| if: (github.event_name == 'push') | |
| outputs: | |
| id: ${{ steps.create_release.outputs.id }} | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Load README | |
| run: | | |
| echo "README<<EOF" >> $GITHUB_ENV | |
| cat README.md >> $GITHUB_ENV | |
| echo 'EOF' >> $GITHUB_ENV | |
| - name: Create Release | |
| id: create_release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: v${{ env.UNP4K_VERSION }} | |
| release_name: unp4k Tools for Star Citizen | |
| body: ${{ env.README }} | |
| draft: true | |
| prerelease: false | |
| upload: | |
| needs: release | |
| runs-on: ubuntu-latest | |
| if: (github.event_name == 'push') | |
| strategy: | |
| max-parallel: 3 | |
| matrix: | |
| artifact: [ unp4k, unp4k-suite, unforge ] | |
| steps: | |
| - name: Load Artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ${{ matrix.artifact }}-v${{ env.UNP4K_VERSION }} | |
| path: ${{ matrix.artifact }} | |
| - name: Compress Artifacts | |
| run: (cd ${{ matrix.artifact }} && zip -r ../${{ matrix.artifact }}.zip .) | |
| - name: Upload Artifacts | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ needs.release.outputs.upload_url }} | |
| asset_path: ${{ matrix.artifact }}.zip | |
| asset_name: ${{ matrix.artifact }}-v${{ env.UNP4K_VERSION }}.zip | |
| asset_content_type: application/zip | |
| publish: | |
| needs: [ upload, release ] | |
| runs-on: ubuntu-latest | |
| if: (github.event_name == 'push') | |
| steps: | |
| - name: Publish Release | |
| uses: StuYarrow/publish-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| id: ${{ needs.release.outputs.id }} |