chore(release): publish #14
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: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: write | |
packages: write | |
id-token: write # needed for provenance data generation | |
jobs: | |
test: | |
name: Publish | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
fetch-depth: 0 | |
- name: Install Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: ".nvmrc" | |
registry-url: https://npm.pkg.github.com/ | |
cache: "yarn" | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install dependencies | |
run: yarn install | |
shell: bash | |
- name: Print Environment Info | |
run: npx nx report | |
shell: bash | |
- name: Configure CI Git User | |
run: | | |
git config --global user.name "${GITHUB_ACTOR}" | |
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
git remote set-url origin https://vymarkov:[email protected]/lazy-orange/nx-workspace-v20 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
- name: Publish packages | |
shell: bash | |
run: | | |
npx nx run-many -t build --all # it must be executed in order to bump version properly | |
npx nx release --verbose --yes # release must not build a package before publishing in order to have proper version | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
# FIXME: update readme doc to cover this topic | |
# npm access token it's a classic github token with permissions to publish to github npm registry | |
NODE_AUTH_TOKEN: ${{ secrets.GH_TOKEN }} | |
NPM_CONFIG_PROVENANCE: false |