Merge pull request #70 from reclaimprotocol/fixing-ai-proofs #61
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: build-deploy | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| inputs: | |
| release_type: | |
| description: "Type of release" | |
| required: true | |
| default: "patch" | |
| type: choice | |
| options: | |
| - patch | |
| - minor | |
| - major | |
| - bugfix | |
| - hotfix | |
| permissions: | |
| contents: write | |
| packages: write | |
| jobs: | |
| test_and_build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: "16" | |
| - name: Clean install dependencies | |
| run: | | |
| rm -rf node_modules | |
| rm -rf package-lock.json | |
| npm i | |
| - name: Build package | |
| run: npm run build | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist | |
| path: dist/ | |
| publish: | |
| needs: test_and_build | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'workflow_dispatch' || github.event_name == 'push' | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| persist-credentials: false # Disable automatic token authentication | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: "16" | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: dist | |
| path: dist/ | |
| - name: Version and publish | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| run: | | |
| npm publish |