Merge pull request #278 from lukso-network/release-please--branches--… #60
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: Create GitHub release and publish to NPM | |
| on: | |
| push: | |
| branches: | |
| - 'main' | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| release-please: | |
| name: Release Please | |
| runs-on: ubuntu-latest | |
| outputs: | |
| release_created: ${{ steps.release.outputs.release_created }} | |
| tag_name: ${{ steps.release.outputs.tag_name }} | |
| steps: | |
| - uses: google-github-actions/release-please-action@v4 | |
| id: release | |
| with: | |
| config-file: release-please-config.json | |
| manifest-file: .release-please-manifest.json | |
| publish: | |
| name: Publish to NPM | |
| needs: release-please | |
| if: needs.release-please.outputs.release_created == 'true' | |
| runs-on: ubuntu-latest | |
| environment: publish | |
| permissions: | |
| contents: read | |
| id-token: write # Required for npm provenance (OIDC) | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: ⚙️ Setup Node.js v22 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22.x' | |
| registry-url: 'https://registry.npmjs.org' | |
| scope: '@lukso' | |
| cache: 'npm' | |
| - name: 🧰 Install | |
| run: npm ci | |
| - name: 💅 Lint | |
| run: npm run lint | |
| - name: 🛠 Build | |
| run: npm run build | |
| - name: 🎯 Test | |
| run: npm test | |
| - name: 📦 Publish to NPM with provenance (npm ≥ 11.5.1 for trusted publishing) | |
| run: npx -y npm@latest publish --access public --provenance |