WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Publish

Publish #61

Workflow file for this run

name: Publish
on:
workflow_dispatch:
jobs:
test:
name: Publish
runs-on: ubuntu-latest
environment: production
permissions:
contents: read
id-token: write # needed for provenance data generation
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
filter: tree:0
- uses: ./.github/actions/setup-node
- run: pnpm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }}
- name: Build publishable packages
run: pnpm nx run-many -p="tag:npm:public" -t=build
- name: Print Environment Info
run: pnpm nx report
shell: bash
- name: Determine npm tag
id: npm-tag
run: |
BRANCH_NAME=${GITHUB_REF#refs/heads/}
if [ "$BRANCH_NAME" = "main" ]; then
echo "tag=latest" >> $GITHUB_OUTPUT
else
echo "tag=$BRANCH_NAME" >> $GITHUB_OUTPUT
fi
- name: Publish packages
run: pnpm nx release publish --excludeTaskDependencies --tag=${{ steps.npm-tag.outputs.tag }}
shell: bash