Skip to content

🚀 Build and release #200

🚀 Build and release

🚀 Build and release #200

name: 🚀 Build and release
on:
release:
types: [created]
jobs:
build-artifacts:
uses: ./.github/workflows/build.yml
permissions:
contents: read
run-unit-tests:
needs: build-artifacts
uses: ./.github/workflows/unit-test.yml
permissions:
contents: read
id-token: write
run-end-to-end-tests:
needs: build-artifacts
uses: ./.github/workflows/end-to-end-tests.yml
permissions:
contents: read
run-benchmarks:
needs: build-artifacts
uses: ./.github/workflows/benchmark.yml
permissions:
contents: read
build:
needs:
- run-unit-tests
- run-end-to-end-tests
- run-benchmarks
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
timeout-minutes: 15
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "24.x"
registry-url: "https://registry.npmjs.org"
scope: "@aikidosec"
- name: Set up Rust
run: |
rustup toolchain install stable
rustup default stable
cargo install wasm-pack
- name: Setup Aikido safe-chain
run: curl -fsSL https://github.com/AikidoSec/safe-chain/releases/latest/download/install-safe-chain.sh | sh -s -- --ci
- name: Downgrade npm
# https://github.com/npm/cli/issues/8669
run: npm i -g npm@11.6.0
- name: Install dependencies
run: npm run install-lib-only
- name: Get the version
id: get_version
run: echo "tag=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
- name: Set the version
run: cd library && npm --no-git-tag-version version ${{ steps.get_version.outputs.tag }}
- name: Build the library
run: npm run build
- name: Linting
run: npm run lint
- name: Publish to NPM
run: |
if [ "${{ github.event.release.prerelease }}" = "true" ]; then
echo "Publishing beta version ${{ steps.get_version.outputs.tag }} to NPM"
cd build && npm stage publish --provenance --access public --tag beta
else
echo "Publishing version ${{ steps.get_version.outputs.tag }} to NPM"
cd build && npm stage publish --provenance --access public
fi