Release packages [publish docs] (#166) #64
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: Changesets Release | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
CreateRelease: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
permissions: | |
id-token: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Fetch all history for all branches and tags | |
token: ${{ secrets.IMJS_ADMIN_GH_TOKEN }} | |
- name: Install pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
run_install: false | |
- name: Use Node.js 18 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
registry-url: https://registry.npmjs.org/ | |
cache: "pnpm" | |
- name: Install dependencies | |
run: pnpm install | |
- name: ESLint | |
run: pnpm run lint | |
- name: Typecheck | |
run: pnpm run typecheck | |
- name: Check changed-elements-react unit test coverage | |
run: npm run test:cover --prefix ./packages/changed-elements-react | |
- name: Run Audit | |
run: pnpm audit --audit-level high | |
- name: Build components | |
run: | | |
cd packages/changed-elements-react && | |
pnpm run build | |
- name: Create release PR or publish to npm | |
id: changesets | |
uses: changesets/[email protected] | |
with: | |
publish: pnpm changeset publish | |
title: Release packages [publish docs] | |
commit: Release packages [publish docs] | |
createGithubReleases: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.IMJS_ADMIN_GH_TOKEN }} | |
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_PUBLISH_ITWIN }} | |
GIT_AUTHOR_NAME: imodeljs-admin | |
GIT_AUTHOR_EMAIL: [email protected] | |
GIT_COMMITTER_NAME: imodeljs-admin | |
GIT_COMMITTER_EMAIL: [email protected] | |
- name: Log Changesets Outputs | |
run: | | |
echo "Published: ${{ steps.changesets.outputs.published }}" | |
echo "Published Packages: ${{ steps.changesets.outputs.publishedPackages }}" | |
echo "Has Changesets: ${{ steps.changesets.outputs.hasChangesets }}" | |
echo "Pull Request Number: ${{ steps.changesets.outputs.pullRequestNumber }}" |