From a477ab6e3588f11feed1c69255777f0510989669 Mon Sep 17 00:00:00 2001 From: Danilo Tuler Date: Tue, 30 Jul 2024 11:49:17 -0300 Subject: [PATCH] feat(paymaster): CI publishing --- .github/workflows/paymaster.yaml | 57 ++++++++++++++++++++++++++++++++ .github/workflows/release.yaml | 9 +++++ 2 files changed, 66 insertions(+) create mode 100644 .github/workflows/paymaster.yaml diff --git a/.github/workflows/paymaster.yaml b/.github/workflows/paymaster.yaml new file mode 100644 index 00000000..d100e854 --- /dev/null +++ b/.github/workflows/paymaster.yaml @@ -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 }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 5ce0a2f7..b87b8301 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -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