Repository navigation
Release #3
This file contains hidden or 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: Release | |
| on: | |
| workflow_dispatch: | |
| permissions: | |
| # allow the release step to comment on | |
| # issues, pull requests, and write to the repo | |
| contents: write | |
| issues: write | |
| pull-requests: write | |
| # allow dispatching the publish workflow (releases created with GITHUB_TOKEN do not trigger it) | |
| actions: write | |
| jobs: | |
| release: | |
| runs-on: [ubuntu-latest] | |
| environment: | |
| name: release | |
| env: | |
| CI: false | |
| NODE_OPTIONS: --max-old-space-size=4096 | |
| HUSKY_SKIP_HOOKS: 1 | |
| HUSKY: 0 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| - uses: pnpm/action-setup@v6 | |
| name: Install pnpm | |
| with: | |
| run_install: false | |
| - name: Use node.js | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version-file: .nvmrc | |
| cache: "pnpm" | |
| - name: Install dependencies | |
| shell: bash | |
| run: pnpm install --frozen-lockfile | |
| - name: Setup environment variables | |
| run: echo "CURRENT_BRANCH=$(echo -n ${{github.head_ref || github.ref_name}})" >> $GITHUB_ENV | |
| - name: Building Packages | |
| run: pnpm build | |
| - name: Check code Style | |
| run: pnpm lint-format | |
| - name: Execute Linter | |
| run: pnpm lint | |
| - name: Typescript Checks # Check this later on to run tsc:full instead to check transitive dependencies as well | |
| run: pnpm tsc | |
| - name: Test packages | |
| run: pnpm --filter "./packages/*" test | |
| - name: Start monorepo release | |
| id: start-monorepo-release | |
| uses: manusant/monorepo-release-start@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Write released packages to a manifest file | |
| run: | |
| # Use explicit single quote otherwise echo removes all double quotes! | |
| echo '${{ steps.start-monorepo-release.outputs.releasedPackages }}' > release.manifest.json | |
| - name: Format Changesets | |
| run: pnpm changeset:format | |
| - name: Re-Install packages | |
| run: | | |
| pnpm install | |
| - name: Finish monorepo release | |
| id: finish-monorepo-release | |
| if: steps.start-monorepo-release.outputs.released | |
| uses: manusant/monorepo-release-finish@v1 | |
| with: | |
| branch: ${{ env.CURRENT_BRANCH }} | |
| releaseBranch: "main" | |
| draft: false | |
| push: true | |
| version: ${{ steps.start-monorepo-release.outputs.version }} | |
| previousPackages: ${{ steps.start-monorepo-release.outputs.oldPackages }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Trigger publish workflow | |
| if: steps.start-monorepo-release.outputs.released | |
| run: gh workflow run publish.yml --ref main | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |