ci: Fix actions packages write permission #12
This file contains 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: Test, build and publish adapters | |
on: | |
push: | |
branches: | |
- 'master' | |
paths: | |
- 'react-17-adapter/**' | |
- '.github/workflows/adapter-release.yaml' | |
env: | |
CI: true | |
jobs: | |
test-build-publish: | |
permissions: | |
contents: write | |
packages: write | |
name: Test and build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: npm | |
registry-url: https://npm.pkg.github.com | |
- name: Build core | |
run: | | |
npm ci | |
npm test | |
npm run build | |
- name: Install dependencies | |
working-directory: ./react-17-adapter | |
run: npm ci | |
- name: Build | |
working-directory: ./react-17-adapter | |
run: npm run build | |
- name: Publish | |
working-directory: ./react-17-adapter | |
run: npx semantic-release | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |