Skip to content

Commit

Permalink
feat(paymaster): CI publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
tuler committed Jul 30, 2024
1 parent 7755228 commit c4214ec
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/paymaster.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: paymaster
on:
workflow_call:
inputs:
release:
type: boolean
required: false
secrets:
NPM_TOKEN:
required: true
TURBO_TOKEN:
required: true
pull_request:
paths:
- .github/workflows/paymaster.yaml
- packages/mock-verifying-paymaster/**
- packages/eslint-config/**
- packages/tsconfig/**
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true
permissions:
contents: read
packages: write
jobs:
build:
runs-on: ubuntu-latest
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
- name: Setup Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: "https://registry.npmjs.org"
cache: "pnpm"

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Install dependencies
run: pnpm install

- name: Build
run: pnpm build --filter @cartesi/mock-verifying-paymaster

- name: Publish
if: ${{ inputs.release }}
working-directory: ./packages/mock-verifying-paymaster
run: pnpm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
9 changes: 9 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,12 @@ jobs:
secrets: inherit
with:
release: true

build_paymaster:
name: Build paymaster
needs: [release, packages_to_build]
if: ${{ needs.release.outputs.published == 'true' && contains(fromJSON(needs.packages_to_build.outputs.packages), '@cartesi/mock-verifying-paymaster') }}
uses: ./.github/workflows/paymaster.yaml
secrets: inherit
with:
release: true

0 comments on commit c4214ec

Please sign in to comment.