Publish latest release #70
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 latest release" | |
on: | |
workflow_dispatch: | |
branches: [main] | |
jobs: | |
publish: | |
name: Publish latest packages | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.BSNORG_ACTIONS_SECRET }} | |
# pulls all commits (needed for lerna / semantic release to correctly version) | |
fetch-depth: "0" | |
- name: Setup .npmrc file for publish | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "16" | |
registry-url: "https://registry.npmjs.org" | |
cache: "npm" | |
- name: Turbo Cache | |
id: turbo-cache | |
uses: actions/cache@v3 | |
with: | |
path: .turbo | |
key: turbo-${{ runner.os }}-${{ github.sha }} | |
restore-keys: | | |
turbo-${{ runner.os }} | |
- run: npm ci | |
- run: npm run build -- --cache-dir=".turbo" | |
- name: Publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
GH_TOKEN: ${{ secrets.BSNORG_ACTIONS_SECRET }} | |
GITHUB_TOKEN: ${{ secrets.BSNORG_ACTIONS_SECRET }} | |
run: | | |
git config user.name 'github-actions[bot]' | |
git config user.email 'github-actions[bot]@users.noreply.github.com' | |
npx lerna publish --dist-tag latest --conventional-graduate --yes --create-release github |