Build tooling changes (#2922) #302
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: 'Publish Release Candidate' | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- '**/package.json' | |
- '.yarn/versions/**' | |
jobs: | |
publish-rc: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Read Node version | |
id: node_version | |
run: echo "NVMRC=$(cat .nvmrc)" >> $GITHUB_OUTPUT | |
- name: Set Node version | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '${{ steps.node_version.outputs.NVMRC }}' | |
registry-url: 'https://registry.npmjs.org' | |
- name: Install dependencies and publish | |
run: yarn && yarn publish:next | |
env: | |
YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTOMATION_FROM_STEPHEN }} | |
- name: Branch protection OFF | |
run: | | |
curl --request PUT \ | |
--url 'https://api.github.com/repos/${{ github.repository }}/branches/main/protection' \ | |
--header 'Authorization: token ${{ secrets.PAT_CHANGE_BRANCH_PROTECTION_RULES_FROM_STEPHEN }}' \ | |
--data '{"required_status_checks":null,"enforce_admins":false,"required_pull_request_reviews":null,"restrictions":null}' | |
- name: Commit release candidate | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: 'Publish release candidate' | |
# https://docs.github.com/en/rest/reference/repos#update-branch-protection-preview-notices | |
- name: Branch protection ON | |
run: | | |
curl --request PUT \ | |
--url 'https://api.github.com/repos/radix-ui/primitives/branches/main/protection' \ | |
--header 'Authorization: token ${{ secrets.PAT_CHANGE_BRANCH_PROTECTION_RULES_FROM_STEPHEN }}' \ | |
--header 'Accept: application/vnd.github.luke-cage-preview+json' \ | |
--data '{"required_status_checks":{"strict":false,"contexts":["UI Tests","check","test"]},"enforce_admins":true,"required_pull_request_reviews":{"require_code_owner_reviews":true,"required_approving_review_count":1},"restrictions":null}' |