chore: downgrade tools #3
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: | |
| runs-on: macos-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Swift via Homebrew | |
| run: | | |
| brew update | |
| brew install swift | |
| swift --version | |
| - name: Get tag name | |
| id: tag | |
| run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT | |
| - name: Build for Apple Silicon (arm64) | |
| run: | | |
| swift build -c release --product iwx --arch arm64 | |
| swift build -c release --product proto-dump --arch arm64 | |
| - name: Build for Intel (x86_64) | |
| run: | | |
| swift build -c release --product iwx --arch x86_64 | |
| swift build -c release --product proto-dump --arch x86_64 | |
| - name: Create universal binaries | |
| run: | | |
| mkdir -p build | |
| lipo -create \ | |
| -output build/iwx \ | |
| .build/arm64-apple-macosx/release/iwx \ | |
| .build/x86_64-apple-macosx/release/iwx | |
| lipo -create \ | |
| -output build/proto-dump \ | |
| .build/arm64-apple-macosx/release/proto-dump \ | |
| .build/x86_64-apple-macosx/release/proto-dump | |
| - name: Verify binaries | |
| run: | | |
| echo "iwx:" | |
| lipo -info build/iwx | |
| echo "proto-dump:" | |
| lipo -info build/proto-dump | |
| - name: Create tarballs | |
| run: | | |
| cd build | |
| tar -czf iwx-${{ steps.tag.outputs.TAG_NAME }}-macos-universal.tar.gz iwx | |
| tar -czf proto-dump-${{ steps.tag.outputs.TAG_NAME }}-macos-universal.tar.gz proto-dump | |
| cd .. | |
| - name: Generate checksums | |
| run: | | |
| cd build | |
| shasum -a 256 *.tar.gz > checksums.txt | |
| cat checksums.txt | |
| cd .. | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| if: github.ref_type == 'tag' | |
| with: | |
| files: | | |
| build/*.tar.gz | |
| build/checksums.txt | |
| body: | | |
| ## Release ${{ steps.tag.outputs.TAG_NAME }} | |
| ### Installation | |
| **macOS (Universal - Intel & Apple Silicon)** | |
| ```bash | |
| # For iwx | |
| curl -L -O https://github.com/${{ github.repository }}/releases/download/${{ steps.tag.outputs.TAG_NAME }}/iwx-${{ steps.tag.outputs.TAG_NAME }}-macos-universal.tar.gz | |
| tar -xzf iwx-${{ steps.tag.outputs.TAG_NAME }}-macos-universal.tar.gz | |
| sudo mv iwx /usr/local/bin/ | |
| # For proto-dump | |
| curl -L -O https://github.com/${{ github.repository }}/releases/download/${{ steps.tag.outputs.TAG_NAME }}/proto-dump-${{ steps.tag.outputs.TAG_NAME }}-macos-universal.tar.gz | |
| tar -xzf proto-dump-${{ steps.tag.outputs.TAG_NAME }}-macos-universal.tar.gz | |
| sudo mv proto-dump /usr/local/bin/ | |
| ``` | |
| ### Checksums | |
| See `checksums.txt` for SHA-256 checksums. | |
| draft: false | |
| prerelease: false |