Don't publish as trimmed (working around an issue in project deserial… #135
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: Build Yarn Spinner | |
| on: | |
| push: | |
| branches: "*" | |
| tags: "*" | |
| pull_request: | |
| branches: "*" | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v1 | |
| with: | |
| dotnet-version: 9.0.x | |
| - name: Fetch all commits | |
| run: git fetch --unshallow | |
| - name: Update version | |
| id: version | |
| run: ./get-version.sh | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Build | |
| run: dotnet build --no-restore --configuration Release | |
| - name: Test | |
| run: dotnet test --no-build --configuration Release --verbosity normal | |
| - name: Package for Windows | |
| run: dotnet publish -r win-x64 -c Release --self-contained true | |
| - uses: actions/upload-artifact@v4 | |
| name: Upload Windows build | |
| with: | |
| name: ysc-win | |
| path: src/YarnSpinner.Console/bin/Release/net9.0/win-x64/publish/ysc.exe | |
| - name: Package for macOS | |
| run: | | |
| dotnet publish -r osx-x64 -c Release --self-contained true | |
| tar -cvf ysc-osx.tar --directory=src/YarnSpinner.Console/bin/Release/net9.0/osx-x64/publish/ . | |
| - uses: actions/upload-artifact@v4 | |
| name: Upload macOS build | |
| with: | |
| name: ysc-osx | |
| path: ysc-osx.tar | |
| outputs: | |
| builtVersion: ${{ steps.version.outputs.SemVer }}-${{ steps.version.outputs.ShortSha }} | |
| release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - uses: actions/download-artifact@v4 | |
| name: Download artifacts | |
| - name: Extract release notes | |
| id: extract-release-notes | |
| uses: ffurrer2/extract-release-notes@v2.2.0 | |
| - name: Read release notes preface | |
| id: release_preface | |
| uses: bluwy/substitute-string-action@v3 | |
| with: | |
| _input-file: .github/RELEASE_TEMPLATE.md | |
| _format-key: "{key}" | |
| env: | |
| INPUT_RELEASE_TAG: ${{ github.ref_name }} | |
| - name: Create release | |
| id: create_release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ github.ref }} | |
| release_name: ${{ needs.build.outputs.builtVersion }} | |
| draft: true | |
| prerelease: true | |
| body: | | |
| ${{ steps.release_preface.outputs.result }} | |
| ${{ steps.extract-release-notes.outputs.release_notes }} | |
| - name: Package Windows build | |
| run: | | |
| zip --junk-paths ysc-win.zip ysc-win/ysc.exe | |
| - name: Upload Windows Build | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ./ysc-win.zip | |
| asset_name: ysc-win-${{ needs.build.outputs.builtVersion }}.zip | |
| asset_content_type: application/zip | |
| - name: Package macOS build | |
| run: | | |
| gzip ysc-osx/ysc-osx.tar | |
| - name: Upload macOS Build | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ./ysc-osx/ysc-osx.tar.gz | |
| asset_name: ysc-osx-${{ needs.build.outputs.builtVersion }}.tar.gz | |
| asset_content_type: application/gzip |