Merge branch 'feature/avail' into fix-sign-eip712 #1063
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: 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] | |
goarch: [amd64, arm64, riscv64] | |
exclude: | |
- goarch: arm64 | |
goos: windows | |
- goarch: riscv64 | |
goos: windows | |
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 | |
release-darwin-arm64: | |
name: Build binaries for darwin arm64 | |
runs-on: macos-14 | |
needs: [release] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: "1.21" | |
- name: Compile arm64 | |
run: go build -tags "darwin arm64" | |
- name: Compress binary | |
run: | | |
tar -czvf nonodo-$GITHUB_REF_NAME-darwin-arm64.tar.gz nonodo | |
- name: Generate MD5 checksum | |
run: md5 -q nonodo-$GITHUB_REF_NAME-darwin-arm64.tar.gz > nonodo-$GITHUB_REF_NAME-darwin-arm64.tar.gz.md5 | |
- name: Upload Artifact | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh release upload $GITHUB_REF_NAME nonodo-$GITHUB_REF_NAME-darwin-arm64.tar.gz --clobber | |
gh release upload $GITHUB_REF_NAME nonodo-$GITHUB_REF_NAME-darwin-arm64.tar.gz.md5 --clobber | |
# release-darwin-amd64: | |
# name: Build binaries for Mac Intel | |
# runs-on: macos-13-large | |
# needs: [release] | |
# steps: | |
# - uses: actions/checkout@v4 | |
# - name: Set up Go | |
# uses: actions/setup-go@v5 | |
# with: | |
# go-version: '1.21' | |
# - name: Install deps | |
# run: | | |
# brew install sqlite3 | |
# brew upgrade icu4c | |
# - name: Compile amd64 | |
# run: go build -tags "darwin amd64" | |
npm-publish-v1: | |
runs-on: ubuntu-latest | |
name: NPM Publish v1 nonodo | |
defaults: | |
run: | |
working-directory: ./npm-package | |
needs: [release-darwin-arm64, releases-matrix] | |
if: startsWith(github.ref, 'refs/tags/v1.') | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: "recursive" | |
- name: Extract tag name | |
id: extract_tag | |
run: echo "::set-output name=tag::$(echo ${GITHUB_REF#refs/tags/})" | |
- name: Update package.json | |
run: | | |
TAG="${{ steps.extract_tag.outputs.tag }}" | |
TAG_NO_V=$(echo "$TAG" | sed 's/^v//') | |
sed -i "s/\"version\": \".*\"/\"version\": \"$TAG_NO_V\"/" package.json | |
echo "Updated version to $TAG_NO_V in package.json" | |
cp package-lock.json .. | |
cat package.json | |
# Setup .npmrc file to publish to npm | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "20.x" | |
registry-url: "https://registry.npmjs.org" | |
cache: "npm" | |
- name: Publish | |
run: | | |
npm ci | |
npm pack | |
npm publish --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
npm-publish-v2: | |
runs-on: ubuntu-latest | |
name: NPM Publish v2 brunodo | |
defaults: | |
run: | |
working-directory: ./npm-package | |
needs: [release-darwin-arm64, releases-matrix] | |
if: startsWith(github.ref, 'refs/tags/v2.') | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: "recursive" | |
- name: Extract tag name | |
id: extract_tag | |
run: echo "::set-output name=tag::$(echo ${GITHUB_REF#refs/tags/})" | |
- name: Update package.json | |
run: | | |
TAG="${{ steps.extract_tag.outputs.tag }}" | |
TAG_NO_V=$(echo "$TAG" | sed 's/^v//') | |
sed -i "s/\"version\": \".*\"/\"version\": \"$TAG_NO_V\"/" package.json | |
sed -i "s/\"name\": \".*\"/\"name\": \"brunodo\"/" package.json | |
sed -i "s/\"nonodo\": \".*\"/\"brunodo\": \".\/src\/nonodo.js\"/" package.json | |
echo "Updated version to $TAG_NO_V in package.json" | |
cp package-lock.json .. | |
cat package.json | |
# Setup .npmrc file to publish to npm | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "20.x" | |
registry-url: "https://registry.npmjs.org" | |
cache: "npm" | |
- name: Publish | |
run: | | |
npm ci | |
npm pack | |
npm publish --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |