v0.50.0 #30
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 Upload .NET binary | |
| on: | |
| release: | |
| types: [published] | |
| jobs: | |
| build-and-pack: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| os: [linux-x64, linux-arm64, win-x64, osx-x64, osx-arm64] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup .NET SDK | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| # Use the .NET SDK from global.json in the root of the repository. | |
| global-json-file: global.json | |
| - name: Extract version (without v) | |
| id: version | |
| run: | | |
| if [ "${{ github.event_name }}" = "release" ]; then | |
| # Extract version from release tag (remove any 'v' prefix) | |
| VERSION="${{ github.event.release.tag_name }}" | |
| VERSION=${VERSION#v} # Remove 'v' prefix if present | |
| else | |
| VERSION="${{ github.event.inputs.version }}" | |
| VERSION=${VERSION#v} # Remove 'v' prefix if present | |
| fi | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "Syncing version: $VERSION" | |
| - name: Build & Publish | |
| run: | | |
| dotnet publish ./src/BuslyCLI.Console/BuslyCLI.Console.csproj \ | |
| --configuration Release \ | |
| --runtime ${{ matrix.os }} \ | |
| --self-contained true \ | |
| --output ./artifacts/binaries/${{ matrix.os }} \ | |
| -p:InformationalVersion=${{ steps.version.outputs.version }} | |
| - name: Create Archive | |
| run: | | |
| TARGET_DIR="./artifacts/binaries/${{ matrix.os }}" | |
| ARCHIVE_DIR="./artifacts/github-release-archives" | |
| OUTPUT_ARCHIVE="../../github-release-archives/busly-cli-${{ github.event.release.tag_name }}-${{ matrix.os }}" | |
| # Ensure the output directory exists | |
| mkdir -p "$ARCHIVE_DIR" | |
| cd "$TARGET_DIR" | |
| if [[ "${{ matrix.os }}" == "win-x64" ]]; then | |
| zip -r "$OUTPUT_ARCHIVE.zip" . | |
| else | |
| tar -czf "$OUTPUT_ARCHIVE.tar.gz" . | |
| fi | |
| - name: Upload Release Asset | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ github.event.release.upload_url }} | |
| asset_path: ./artifacts/github-release-archives/busly-cli-${{ github.event.release.tag_name }}-${{ matrix.os }}.${{ matrix.os == 'win-x64' && 'zip' || 'tar.gz' }} | |
| asset_name: busly-cli-${{ github.event.release.tag_name }}-${{ matrix.os }}.${{ matrix.os == 'win-x64' && 'zip' || 'tar.gz' }} | |
| asset_content_type: ${{ matrix.os == 'win-x64' && 'application/zip' || 'application/gzip' }} |