v2.0.0-beta.2 #18
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: Publish-Release-To-Artifacts | |
| on: | |
| release: | |
| types: [published] | |
| jobs: | |
| release: | |
| name: Release | |
| permissions: | |
| contents: write | |
| strategy: | |
| matrix: | |
| kind: ['linux', 'windows', 'macOS'] | |
| include: | |
| - kind: linux | |
| os: ubuntu-latest | |
| target: linux-x64 | |
| - kind: windows | |
| os: windows-latest | |
| target: win-x64 | |
| - kind: macOS | |
| os: macos-latest | |
| target: osx-x64 | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup dotnet | |
| uses: actions/setup-dotnet@v5.2.0 | |
| - name: Build | |
| shell: bash | |
| run: | | |
| tag=$(git describe --tags --abbrev=0) | |
| release_name="SharpFM-$tag-${{ matrix.target }}" | |
| # Build everything | |
| dotnet publish src/SharpFM/SharpFM.csproj --runtime "${{ matrix.target }}" -c Release -o "$release_name" | |
| # Pack files | |
| if [ "${{ matrix.target }}" == "win-x64" ]; then | |
| # Pack to zip for Windows | |
| 7z a -tzip "${release_name}.zip" "./${release_name}/*" | |
| else | |
| tar czvf "${release_name}.tar.gz" "$release_name" | |
| fi | |
| # Delete output directory | |
| rm -r "$release_name" | |
| - name: Publish | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| # Narrowed to the versioned archive pattern: SharpFM-v{tag}-{target}.{tar.gz|zip}. | |
| # The previous "SharpFM*" glob also matched SharpFM.sln at the | |
| # repo root, which three parallel matrix runners then raced to | |
| # upload, producing "Not Found" errors on the update endpoint. | |
| files: "SharpFM-*" | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |