CI #4
Workflow file for this run
This file contains 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: CI | |
on: push | |
permissions: | |
contents: write | |
env: | |
ANVIL_TAG: nightly-2cdbfaca634b284084d0f86357623aef7a0d2ce3 | |
jobs: | |
build: | |
name: Build and test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Clang | |
run: sudo apt-get update && sudo apt-get install -y clang | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: "1.21" | |
- name: Install Foundry | |
uses: foundry-rs/foundry-toolchain@v1 | |
with: | |
version: ${{ env.ANVIL_TAG }} | |
- name: Lint | |
uses: golangci/golangci-lint-action@v6 | |
with: | |
args: --timeout=5m --out-format=colored-line-number | |
version: latest | |
- name: Check generate | |
run: make check-gen | |
- name: Build | |
run: make build | |
- name: Run node v2 database | |
run: make up-db-raw | |
- name: Test | |
run: make test | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
needs: [build] | |
if: startsWith(github.ref, 'refs/tags/v') | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Trim CHANGELOG.md | |
run: sed -e '0,/^##[^#]/d' -e '/^##[^#]/,$d' -i CHANGELOG.md | |
- name: Publish Github release | |
uses: softprops/action-gh-release@v2 | |
with: | |
prerelease: true | |
body_path: CHANGELOG.md | |
releases-matrix: | |
name: Build binaries for release | |
runs-on: ubuntu-latest | |
needs: [release] | |
strategy: | |
matrix: | |
goos: [linux, windows, darwin] | |
goarch: [amd64, arm64, riscv64] | |
exclude: | |
- goarch: arm64 | |
goos: windows | |
- goarch: riscv64 | |
goos: windows | |
- goarch: riscv64 | |
goos: darwin | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: wangyoucao577/go-release-action@v1 | |
with: | |
overwrite: true | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
goos: ${{ matrix.goos }} | |
goarch: ${{ matrix.goarch }} | |
extra_files: CHANGELOG.md LICENSE README.md |