chore: adds build step to publish workflow #12
Workflow file for this run
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 libraries | |
on: | |
push: | |
tags: | |
- v*.*.* | |
jobs: | |
test: | |
name: Publish | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
id-token: write | |
timeout-minutes: 10 | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} | |
NPM_CONFIG_PROVENANCE: true | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
# TODO: Figure this out - @russell.green | |
# - name: Exit if not on main branch | |
# if: endsWith(github.ref, 'main') == false | |
# run: exit -1 | |
- name: Install NodeJS | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
registry-url: https://registry.npmjs.org/ | |
- name: Install dependencies | |
run: npm ci | |
- name: Print environment info | |
run: npm run nx -- report | |
# Switch back to using NX once this bug is fixed: | |
# https://github.com/nrwl/nx/issues/21855 - @russell.green | |
# | |
# - name: Publish packages | |
# run: npm run nx -- release publish | |
# env: | |
# NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }} | |
# NPM_CONFIG_PROVENANCE: true | |
# TODO: Remove these steps once the above step is able to | |
# be added back in - @russell.green | |
- name: Build libraries | |
run: npm run build:ci | |
- name: Create NPM registry creds for "core" package | |
run: echo $'@ng-supabase:registry = "https://registry.npmjs.org/"\r//registry.npmjs.org/:_authToken=${{ secrets.NODE_AUTH_TOKEN }}' > dist/libs/core/.npmrc | |
- name: Publish "core" package | |
run: cp .npmrc dist/libs/core && cd dist/libs/core && npm publish --access public | |
- name: Create NPM registry creds for "bootstrap" package | |
run: echo $'@ng-supabase:registry = "https://registry.npmjs.org/"\r//registry.npmjs.org/:_authToken=${{ secrets.NODE_AUTH_TOKEN }}' > dist/libs/bootstrap/.npmrc | |
- name: Publish "bootstrap" package | |
run: cp .npmrc dist/libs/bootstrap && cd dist/libs/bootstrap && npm publish --access public | |
- name: Create NPM registry creds for "material" package | |
run: echo $'@ng-supabase:registry = "https://registry.npmjs.org/"\r//registry.npmjs.org/:_authToken=${{ secrets.NODE_AUTH_TOKEN }}' > dist/libs/material/.npmrc | |
- name: Publish "material" package | |
run: cp .npmrc dist/libs/material && cd dist/libs/material && npm publish --access public | |
- name: Create NPM registry creds for "primeng" package | |
run: echo $'@ng-supabase:registry = "https://registry.npmjs.org/"\r//registry.npmjs.org/:_authToken=${{ secrets.NODE_AUTH_TOKEN }}' > dist/libs/primeng/.npmrc | |
- name: Publish "primeng" package | |
run: cp .npmrc dist/libs/primeng && cd dist/libs/primeng && npm publish --access public |