-
-
Notifications
You must be signed in to change notification settings - Fork 7
102 lines (89 loc) · 3.3 KB
/
packages-release.yml
File metadata and controls
102 lines (89 loc) · 3.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# Package Release Workflow
#
# This workflow handles versioning and publishing of @testplanit/* packages to npm.
# It uses Changesets to manage versions and changelogs.
#
# How it works:
# 1. When PRs with changesets are merged to main, this workflow runs
# 2. It creates/updates a "Version Packages" PR with version bumps and changelog updates
# 3. When the "Version Packages" PR is merged, packages are published to npm
#
# To release:
# 1. Create a changeset: pnpm changeset
# 2. Commit and merge to main
# 3. Review and merge the auto-created "Version Packages" PR
#
name: Package Release
on:
push:
branches:
- main
paths:
- 'packages/**'
- '.changeset/**'
- '.github/workflows/packages-release.yml'
workflow_dispatch:
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: '24'
cache: 'pnpm'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: pnpm install --frozen-lockfile --ignore-scripts
env:
NODE_OPTIONS: '--max-old-space-size=4096'
- name: Generate Prisma client
run: pnpm --filter "testplanit" exec prisma generate
- name: Run package tests
run: |
pnpm --filter "@testplanit/api" test -- --run
pnpm --filter "@testplanit/wdio-reporter" test -- --run
pnpm --filter "@testplanit/mcp-server" test -- --run
- name: Build packages
run: |
pnpm --filter "@testplanit/api" build
pnpm --filter "@testplanit/wdio-reporter" build
pnpm --filter "@testplanit/mcp-server" build
# Trusted publishing (OIDC) requires npm CLI >= 11.5.1. Node 24 ships
# npm 11.x, but pin to latest so the OIDC handshake can't silently fall
# back to anonymous auth — the cause of E404 on scoped-package publishes.
- name: Ensure npm supports trusted publishing
run: npm install -g npm@latest
- name: Create Release Pull Request or Publish
id: changesets
uses: changesets/action@v1
with:
publish: pnpm changeset publish
version: pnpm changeset version
title: 'chore(packages): version packages'
commit: 'chore(packages): version packages'
createGithubReleases: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# No NPM_TOKEN — publishing authenticates via OIDC trusted publishing
# (id-token: write above + the trusted publisher configured on npm).
- name: Summary
if: steps.changesets.outputs.published == 'true'
run: |
echo "## Published Packages" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "The following packages were published:" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo '${{ steps.changesets.outputs.publishedPackages }}' | jq -r '.[] | "- \(.name)@\(.version)"' >> $GITHUB_STEP_SUMMARY