release #3
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: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Release version (e.g. 1.0.0)' | |
| required: true | |
| type: string | |
| jobs: | |
| build_and_release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 8.0 | |
| - name: Build | |
| run: dotnet build -c Release | |
| - name: Test | |
| run: dotnet test --no-restore | |
| - name: Publish linux-x64 | |
| run: dotnet publish -c Release -r linux-x64 --self-contained false -o release-linux /p:"AssemblyVersion=${{ inputs.version }};FileVersion=${{ inputs.version }};InformationalVersion=${{ inputs.version }}" | |
| - name: Publish win-x64 | |
| run: dotnet publish -c Release -r win-x64 --self-contained false -o release-win /p:"AssemblyVersion=${{ inputs.version }};FileVersion=${{ inputs.version }};InformationalVersion=${{ inputs.version }}" | |
| - name: Prepare artifacts | |
| run: | | |
| cp {README,xvd_info,CHANGELOG}.md release-linux | |
| cp {README,xvd_info,CHANGELOG}.md release-win | |
| - name: Generate zips | |
| run: | | |
| zip -j xvdtool-linux-x64.zip release-linux/* | |
| zip -j xvdtool-win32-x64.zip release-win/* | |
| - name: Create release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| name: Release v${{ inputs.version }} | |
| tag_name: v${{ inputs.version }} | |
| generate_release_notes: true | |
| files: | | |
| xvdtool-linux-x64.zip | |
| xvdtool-win32-x64.zip | |
| fail_on_unmatched_files: true |