Skip to content

Merge pull request #106 from NillionNetwork/fix/eddsa-signatures #52

Merge pull request #106 from NillionNetwork/fix/eddsa-signatures

Merge pull request #106 from NillionNetwork/fix/eddsa-signatures #52

Workflow file for this run

name: CD
on:
push:
branches: ["main"]
workflow_dispatch:
concurrency:
group: "publish"
cancel-in-progress: true
jobs:
publish:
name: Publish
runs-on: ubuntu-latest
strategy:
matrix:
pkg:
- package-name: "client-wasm"
- package-name: "client-vms"
- package-name: "client-react-hooks"
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "0.4.24"
- name: Set up Python
run: uv python install
- name: Check version
id: check-version
run: >-
cd scripts/version_checker && uv run ./version_checker.py ../../${{ matrix.pkg.package-name }}
- name: Install rustup
if: matrix.pkg.package-name == 'client-wasm' && steps.check-version.outputs.local_version_is_higher == 'true'
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2024-07-01
target: wasm32-unknown-unknown
- uses: actions/setup-node@v4
if: steps.check-version.outputs.local_version_is_higher == 'true'
with:
node-version: "23.0"
registry-url: "https://registry.npmjs.org"
- uses: pnpm/action-setup@v4
if: steps.check-version.outputs.local_version_is_higher == 'true'
- run: pnpm install
if: steps.check-version.outputs.local_version_is_higher == 'true'
- name: Build client-wasm
if: matrix.pkg.package-name == 'client-wasm' && steps.check-version.outputs.local_version_is_higher == 'true'
run: |
npm pack --filter ./client-wasm
- name: Build client-vms
if: matrix.pkg.package-name == 'client-vms' && steps.check-version.outputs.local_version_is_higher == 'true'
run: |
pnpm build:proto
pnpm --filter "@nillion/client-vms" build
npm pack --filter ./client-vms
- name: Build client-react-hooks
if: matrix.pkg.package-name == 'client-react-hooks' && steps.check-version.outputs.local_version_is_higher == 'true'
run: |
pnpm build:proto
pnpm --filter "@nillion/client-vms" build
pnpm --filter "@nillion/client-react-hooks" build
npm pack --filter ./client-react-hooks
- env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
if: steps.check-version.outputs.local_version_is_higher == 'true'
run: pnpm --filter "@nillion/${{ matrix.pkg.package-name }}" publish --tag ${{ steps.check-version.outputs.tag }} --no-git-checks
- name: Create GH Release
id: create-release
if: steps.check-version.outputs.local_version_is_higher == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
[[ "${{ steps.check-version.outputs.tag }}" == "next" ]] && PRERELEASE="-p" || PRERELEASE=""
gh release create '${{ matrix.pkg.package-name }}-v${{ steps.check-version.outputs.local_version }}' --generate-notes $PRERELEASE --title "${{ matrix.pkg.package-name }}-v${{ steps.check-version.outputs.local_version }}"
- name: Upload artifact to GH Release
if: steps.check-version.outputs.local_version_is_higher == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: >-
gh release upload '${{ matrix.pkg.package-name }}-v${{ steps.check-version.outputs.local_version }}' *.tgz