Skip to content

chore(ui-scripts): implement trusted publishing for npm #2

chore(ui-scripts): implement trusted publishing for npm

chore(ui-scripts): implement trusted publishing for npm #2

name: Manual release to npm (Reusable)

Check failure on line 1 in .github/workflows/_manual-release-reusable.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/_manual-release-reusable.yml

Invalid workflow file

(Line: 5, Col: 7): Unexpected value 'inherit'
on:
workflow_call:
secrets:
inherit
permissions:
id-token: write
contents: write
jobs:
release:
runs-on: ubuntu-latest
name: Release to npm
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v4
- name: Install Node 22
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'pnpm'
- name: Install packages
run: pnpm install --frozen-lockfile
- name: Set up project
run: pnpm run bootstrap
- name: Release to NPM
run: pnpm run release
- name: Get commit message
run: | # puts the first line of the last commit message to the commmit_message env var
echo "commmit_message=$(git log --format=%B -n 1 ${{ github.event.after }} | head -n 1)" >> $GITHUB_ENV
- name: Set up git identity
if: "startsWith(env.commmit_message, 'chore(release)')"
run: git config --global user.name "instructure-ui-ci" && git config --global user.email "instructure-ui-ci@instructure.com"
# -a -m is needed to make the tag "annotated". Lerna needs annotated tags to work correctly with versions
- name: Add tag
if: "startsWith(env.commmit_message, 'chore(release)')"
run: git tag -a v$(./.github/workflows/calculateVersion.sh) -m v$(./.github/workflows/calculateVersion.sh)
- name: Push tags
if: "startsWith(env.commmit_message, 'chore(release)')"
run: git push origin v$(./.github/workflows/calculateVersion.sh)