trim out options #4
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: Build and Release | |
| on: | |
| push: | |
| branches: [ master, main ] | |
| pull_request: | |
| branches: [ master, main ] | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '8.0.x' | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Build and publish for multiple platforms | |
| run: | | |
| dotnet publish -c Release --self-contained -r osx-x64 | |
| dotnet publish -c Release --self-contained -r linux-x64 | |
| dotnet publish -c Release --self-contained -r win-x64 | |
| - name: Upload Linux x64 artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: linux-x64-binaries | |
| path: cli-exakvdocsign/bin/Release/net8.0/linux-x64/publish/ | |
| - name: Upload macOS x64 artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: osx-x64-binaries | |
| path: cli-exakvdocsign/bin/Release/net8.0/osx-x64/publish/ | |
| - name: Upload Windows x64 artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: win-x64-binaries | |
| path: cli-exakvdocsign/bin/Release/net8.0/win-x64/publish/ | |
| release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| - name: Create Release | |
| id: create_release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: v${{ github.run_number }} | |
| release_name: Release v${{ github.run_number }} | |
| body: ${{ github.event.head_commit.message }} | |
| draft: true | |
| prerelease: false | |
| - name: Upload linux-x64 Release Asset | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ./linux-x64-binaries | |
| asset_name: linux-x64-binaries.zip | |
| asset_content_type: application/zip | |
| - name: Upload osx-x64 Release Asset | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ./osx-x64-binaries | |
| asset_name: osx-x64-binaries.zip | |
| asset_content_type: application/zip | |
| - name: Upload win-x64 Release Asset | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ./win-x64-binaries | |
| asset_name: win-x64-binaries.zip | |
| asset_content_type: application/zip |