Include version tag in release asset filenames #7
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: | |
| - "*" | |
| jobs: | |
| build-and-release: | |
| name: Build and Upload Release Assets | |
| runs-on: macos-26 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Get Version from Tag | |
| id: version | |
| run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT | |
| - name: Select Xcode | |
| run: | | |
| sudo xcode-select -s /Applications/Xcode_26.1.app/Contents/Developer | |
| xcodebuild -version | |
| - name: Check Swift Version | |
| run: swift --version | |
| - name: Build Release Binary | |
| run: | | |
| swift build -c release --arch arm64 | |
| - name: Prepare Binary | |
| run: | | |
| mkdir -p release | |
| cp .build/arm64-apple-macosx/release/files release/files | |
| chmod +x release/files | |
| cd release | |
| tar -czf files-macos-arm64-${{ steps.version.outputs.tag }}.tar.gz files | |
| - 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: ./release/files-macos-arm64-${{ steps.version.outputs.tag }}.tar.gz | |
| asset_name: files-macos-arm64-${{ steps.version.outputs.tag }}.tar.gz | |
| asset_content_type: application/gzip |