Build linux-arm64 on correct runner #1
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: | |
| - "*.*.*" | |
| permissions: | |
| actions: read | |
| contents: write | |
| jobs: | |
| validate: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Validate tag format | |
| run: | | |
| echo "Using tag: ${{ github.ref_name }}" | |
| if ! [[ "${{ github.ref_name }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | |
| echo "Tag format is invalid. Expected semantic versioning (e.g., 1.2.3)." | |
| exit 1 | |
| fi | |
| build: | |
| strategy: | |
| matrix: | |
| runs-on: [ | |
| "macos-latest", | |
| "ubuntu-latest", | |
| "ubuntu-24.04-arm" | |
| ] | |
| runs-on: ${{ matrix.runs-on }} | |
| needs: | |
| - validate | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| repository: apple/swift-protobuf | |
| ref: ${{ github.ref_name }} | |
| - name: Set build configuration | |
| id: build-info | |
| run: | | |
| if [[ $(uname) == "Darwin" ]]; then | |
| echo "build_os=macos" >> "$GITHUB_OUTPUT" | |
| elif [[ $(uname) == "Linux" ]]; then | |
| echo "build_os=linux" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "Unsupported OS" | |
| exit 1 | |
| fi | |
| if [[ "$(uname -m)" == "aarch64" ]]; then | |
| echo "build_arch=arm64" >> "$GITHUB_OUTPUT" | |
| elif [[ "$(uname -m)" == "arm64" ]]; then | |
| echo "build_arch=arm64" >> "$GITHUB_OUTPUT" | |
| elif [[ "$(uname -m)" == "x86_64" ]]; then | |
| echo "build_arch=amd64" >> "$GITHUB_OUTPUT" | |
| elif [[ "$(uname -m)" == "amd64" ]]; then | |
| echo "build_arch=amd64" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "Unsupported architecture" | |
| exit 1 | |
| fi | |
| - name: Build protoc-gen-swift | |
| run: | | |
| echo "Building protoc-gen-swift-${{ steps.build-info.outputs.build_os }}-${{ steps.build-info.outputs.build_arch }}" | |
| swift build -c release | |
| mv .build/release/protoc-gen-swift protoc-gen-swift-${{ steps.build-info.outputs.build_os }}-${{ steps.build-info.outputs.build_arch }} | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: protoc-gen-swift-${{ steps.build-info.outputs.build_os }}-${{ steps.build-info.outputs.build_arch }} | |
| path: protoc-gen-swift-${{ steps.build-info.outputs.build_os }}-${{ steps.build-info.outputs.build_arch }} | |
| publish: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - build | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| - run: ls -l; ls -l protoc-gen-swift-* | |
| - uses: softprops/action-gh-release@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda | |
| with: | |
| files: '**/protoc-gen-swift-*' |