| name: Publish package | |
| on: | |
| workflow_dispatch: | |
| release: | |
| types: [published] | |
| permissions: | |
| contents: read | |
| packages: write | |
| concurrency: | |
| group: publish-package | |
| cancel-in-progress: false | |
| jobs: | |
| publish: | |
| name: Publish loop-contract-schema to GitHub Packages | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: packages/loop-contract-schema | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| registry-url: "https://npm.pkg.github.com" | |
| scope: "@chaoyue0307" | |
| - name: Validate the example contracts before publishing | |
| run: node bin/cli.js ../../examples/pr-babysitter-loop.json | |
| - name: Publish | |
| run: npm publish | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |