Publish #89
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: | |
secrets: | |
GITHUB_TOKEN: | |
required: true | |
NPM_TOKEN: | |
required: true | |
jobs: | |
publish: | |
name: Publish to npm | |
environment: Publish | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
persist-credentials: false | |
token: ${{ secrets.GH_TOKEN }} | |
# Workaround for corepack enable in node | |
# Source: (https://github.com/actions/setup-node/issues/899#issuecomment-1828798029) | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- run: corepack enable | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: yarn | |
# End workaround | |
- name: Config and Build | |
run: | | |
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN} | |
yarn install --immutable | |
yarn build | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Publish (All) | |
if: github.event.inputs.workspace == '' | |
run: yarn release | |
env: | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Update Apps | |
run: | | |
yarn install --no-immutable | |
yarn e2e install --no-immutable | |
yarn example install --no-immutable | |
- name: Commit Updated App Locks | |
run: | | |
git add yarn.lock | |
git add examples/E2E/yarn.lock | |
git add examples/AnalyticsReactNativeExample/yarn.lock | |
git commit -m "chore(release): update lockfiles [skip ci]" --no-verify | |
git push |