Publish #7
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 | |
on: | |
workflow_dispatch: | |
branches: | |
- main | |
permissions: | |
contents: read # for checkout | |
jobs: | |
publish: | |
name: Publish | |
runs-on: macos-15 | |
permissions: | |
contents: write # to be able to publish a GitHub release | |
issues: write # to be able to comment on released issues | |
pull-requests: write # to be able to comment on released pull requests | |
id-token: write # to enable use of OIDC for npm provenance | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Configure JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
# semantic-release uses npm to do final prepare + package + publish | |
# npm will not tolerate node_modules directories installed via yarn | |
# so yarn must not be used in this workflow | |
# there will be errors related to pod-install but we can ignore them | |
- name: Install dependencies using NPM | |
run: npm i | |
# The release script runs packages/react-native/package.json::prepublishOnly | |
# which will generate these artifacts, but it does that *after* it commits | |
# to git, so we don't get the Android AAR or the reference API typedoc unless | |
# we generate them prior to running the release | |
- name: Generate artifacts before release | |
run: | | |
npm run build:core | |
npm run gen:reference | |
- name: Release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: npx semantic-release |