build.yml #691
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
| permissions: | |
| contents: write | |
| name: build.yml | |
| on: | |
| workflow_dispatch: | |
| push: | |
| tags: | |
| - 'v**' | |
| branches: | |
| - main | |
| - dev | |
| - refactor | |
| paths-ignore: | |
| - '**/*.md' | |
| pull_request: | |
| branches: | |
| - main | |
| - dev | |
| - refactor | |
| paths-ignore: | |
| - '**/*.md' | |
| jobs: | |
| build-macos: | |
| runs-on: macos-15 | |
| steps: | |
| - name: Checkout | |
| uses: 'actions/checkout@v5' | |
| with: | |
| lfs: 'true' | |
| - name: Set up Go | |
| uses: 'actions/setup-go@v6' | |
| with: | |
| go-version: '1.25.5' | |
| - name: Install dependencies | |
| run: brew install golangci-lint libarchive e2fsprogs bzip2 zlib | |
| - name: Build release archive | |
| run: go run scripts/build.go | |
| - name: Upload artifact | |
| uses: 'actions/upload-artifact@v7' | |
| with: | |
| name: revm-darwin | |
| path: | | |
| revm-*.tar.zst | |
| if-no-files-found: error | |
| overwrite: true | |
| build-linux: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - runner: ubuntu-22.04 | |
| artifact_name: revm-linux-x86_64 | |
| - runner: ubuntu-22.04-arm | |
| artifact_name: revm-linux-aarch64 | |
| runs-on: ${{ matrix.runner }} | |
| env: | |
| LINUX_BUILDER_IMAGE: revm-builder:ubuntu-25.10 | |
| steps: | |
| - name: Checkout | |
| uses: 'actions/checkout@v5' | |
| with: | |
| lfs: 'true' | |
| - name: Build Linux builder image | |
| run: docker build -t "$LINUX_BUILDER_IMAGE" . | |
| - name: Build release archive | |
| run: | | |
| docker run --rm \ | |
| -e GITHUB_WORKSPACE="$GITHUB_WORKSPACE" \ | |
| --workdir "$GITHUB_WORKSPACE" \ | |
| -v "$GITHUB_WORKSPACE:$GITHUB_WORKSPACE" \ | |
| "$LINUX_BUILDER_IMAGE" \ | |
| bash -c ' | |
| git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
| go run scripts/build.go | |
| ' | |
| - name: Upload artifact | |
| uses: 'actions/upload-artifact@v7' | |
| with: | |
| name: ${{ matrix.artifact_name }} | |
| path: | | |
| revm-*.tar.zst | |
| if-no-files-found: error | |
| overwrite: true | |
| release: | |
| needs: [build-macos, build-linux] | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/') | |
| steps: | |
| - name: Download all artifacts | |
| uses: 'actions/download-artifact@v7' | |
| with: | |
| pattern: '*' | |
| merge-multiple: true | |
| - name: Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| generate_release_notes: true | |
| files: | | |
| revm-*.tar.zst | |
| append_body: true | |
| draft: false | |
| prerelease: false | |
| make_latest: true |