GitHub Action to create self-contained platform builds and attach the… #1
Workflow file for this run
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: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| include: | |
| - rid: osx-arm64 | |
| os: macos-latest | |
| artifact: FileDeduplicator-osx-arm64 | |
| - rid: osx-x64 | |
| os: macos-latest | |
| artifact: FileDeduplicator-osx-x64 | |
| - rid: linux-x64 | |
| os: ubuntu-latest | |
| artifact: FileDeduplicator-linux-x64 | |
| - rid: linux-arm64 | |
| os: ubuntu-latest | |
| artifact: FileDeduplicator-linux-arm64 | |
| - rid: win-x64 | |
| os: windows-latest | |
| artifact: FileDeduplicator-win-x64 | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '9.0.x' | |
| - name: Publish | |
| run: dotnet publish FileDeduplicator/FileDeduplicator.csproj -c Release -r ${{ matrix.rid }} -o publish/${{ matrix.rid }} | |
| - name: Create zip (Linux/macOS) | |
| if: runner.os != 'Windows' | |
| run: | | |
| cd publish/${{ matrix.rid }} | |
| zip -r ../../${{ matrix.artifact }}.zip . | |
| - name: Create zip (Windows) | |
| if: runner.os == 'Windows' | |
| run: Compress-Archive -Path publish/${{ matrix.rid }}/* -DestinationPath ${{ matrix.artifact }}.zip | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.artifact }} | |
| path: ${{ matrix.artifact }}.zip | |
| release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| merge-multiple: true | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| generate_release_notes: true | |
| files: artifacts/*.zip |