Skip to content

Commit 8e2a44a

Browse files
authored
chore(repo): add release pipeline (#37)
1 parent e32714d commit 8e2a44a

File tree

14 files changed

+511
-47
lines changed

14 files changed

+511
-47
lines changed

Diff for: .github/workflows/release.yml

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Release Angular Rspack
2+
env:
3+
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
4+
NX_RUN_GROUP: ${{ github.run_id }}-${{ github.run_attempt }}
5+
6+
on:
7+
workflow_dispatch:
8+
inputs:
9+
specifier:
10+
description: 'Semver specifier for the current release (e.g. "patch", "preminor", "1.2.3")'
11+
type: string
12+
required: true
13+
dist-tag:
14+
description: 'dist-tag to use for publish to https://registry.npmjs.org'
15+
required: true
16+
type: choice
17+
options:
18+
- infer-from-specifier
19+
- latest
20+
- next
21+
dry-run:
22+
description: 'Whether to run the release in dry-run mode'
23+
type: boolean
24+
default: true
25+
first-release:
26+
description: 'Whether this is the first release of any packages in the group'
27+
type: boolean
28+
default: false
29+
30+
run-name: "${{ github.event.inputs.dry-run == 'true' && '[dry-run]: ' || '' }}Release Angular Rspack packages => '${{ github.event.inputs.specifier }}' [dist-tag: '${{ github.event.inputs.dist-tag }}']"
31+
32+
jobs:
33+
release:
34+
if: github.repository == 'nrwl/angular-rspack'
35+
runs-on: ubuntu-latest
36+
permissions:
37+
contents: write
38+
id-token: write # needed for provenance data generation
39+
env:
40+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
41+
NPM_CONFIG_PROVENANCE: true
42+
GH_TOKEN: ${{ github.token }}
43+
44+
steps:
45+
- name: Checkout
46+
uses: actions/checkout@v4
47+
with:
48+
fetch-depth: 0
49+
50+
- name: Setup pnpm
51+
uses: pnpm/action-setup@v4
52+
53+
# Cache node_modules
54+
- name: Cache node_modules
55+
uses: actions/setup-node@v4
56+
with:
57+
node-version: 20.12
58+
cache: 'pnpm'
59+
60+
- name: Install dependencies
61+
run: pnpm install --frozen-lockfile
62+
63+
- name: Release packages
64+
run: pnpm release --version ${{ github.event.inputs.specifier }} --dist-tag ${{ github.event.inputs.dist-tag }} --dry-run=${{ github.event.inputs.dry-run }} --first-release=${{ github.event.inputs.first-release }}

Diff for: nx.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,12 @@
7272
"currentVersionResolver": "git-tag",
7373
"fallbackCurrentVersionResolver": "disk"
7474
},
75-
"preVersionCommand": "pnpm nx run-many -t build --exclude=\"apps/**\" --skip-sync"
75+
"preVersionCommand": "pnpm nx run-many -t build --projects=\"tag:publishable\""
76+
},
77+
"changelog": {
78+
"workspaceChangelog": {
79+
"createRelease": "github"
80+
}
7681
}
7782
},
7883
"plugins": [

Diff for: package.json

+4-7
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,7 @@
77
"eslint-next/nx": "pnpx tsx --tsconfig tools/tsconfig.tools.json tools/scripts/eslint-next/bin.ts --report",
88
"check-format": "pnpx nx format:check",
99
"check-commit": "pnpm exec commitlint --from HEAD~1 --to HEAD",
10-
"release:rsbuild:dry": "pnpm nx release --projects=compiler,rsbuild-plugin-angular,rsbuild-plugin-nx --dry-run",
11-
"release:rsbuild:pre": "pnpm nx release prerelease --projects=compiler,rsbuild-plugin-angular,rsbuild-plugin-nx",
12-
"release:rspack:dry": "pnpm nx release --projects=compiler,build,nx --dry-run",
13-
"release:rspack:pre": "pnpm nx release prerelease --projects=compiler,build,nx",
14-
"release:all:dry": "pnpm nx release --projects=compiler,build,nx,rsbuild-plugin-angular,rsbuild-plugin-nx --dry-run",
15-
"release:all:pre": "pnpm nx release prerelease --projects=compiler,build,nx,rsbuild-plugin-angular,rsbuild-plugin-nx"
10+
"release": "tsx tools/scripts/release.ts"
1611
},
1712
"private": true,
1813
"devDependencies": {
@@ -83,13 +78,15 @@
8378
"tcp-port-used": "^1.0.2",
8479
"ts-morph": "^24.0.0",
8580
"ts-node": "10.9.1",
81+
"tsx": "^4.19.3",
8682
"typescript": "5.6.3",
8783
"typescript-eslint": "^8.13.0",
8884
"verdaccio": "^5.0.4",
8985
"vite": "^5.0.0",
9086
"vite-plugin-dts": "^4.5.0",
9187
"vitest": "^1.3.1",
92-
"webpack-merge": "^6.0.1"
88+
"webpack-merge": "^6.0.1",
89+
"yargs": "^17.7.2"
9390
},
9491
"nx": {
9592
"includedScripts": []

Diff for: packages/angular-rsbuild/.npmignore

+5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
!dist
22
dist/tsconfig.lib.tsbuildinfo
3+
code-pushup.config.ts
4+
eslint.next.config.js
35
eslint.config.js
46
project.json
57
tsconfig.json
68
tsconfig.lib.json
79
tsconfig.spec.json
810
vite.config.ts
911
src/**/*.ts
12+
mocks
13+
vitest.config.mts
14+
vitest.integration.config.mts

Diff for: packages/angular-rsbuild/package.json

+3
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@
4545
"sourceRoot": "packages/angular-rsbuild/src",
4646
"projectType": "library",
4747
"name": "angular-rsbuild",
48+
"tags": [
49+
"publishable"
50+
],
4851
"targets": {
4952
"integration-test": {
5053
"dependsOn": [

Diff for: packages/angular-rspack-compiler/.npmignore

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
!dist
22
dist/tsconfig.lib.tsbuildinfo
3+
code-pushup.config.ts
4+
eslint.next.config.js
35
eslint.config.*js
46
project.json
57
tsconfig.json
@@ -9,3 +11,5 @@ vitest*.config.*ts
911
src/**/*.ts
1012
mocks
1113
**/*.tgz
14+
vitest.config.mts
15+
vitest.integration.config.mts

Diff for: packages/angular-rspack-compiler/package.json

+3
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@
5454
"sourceRoot": "packages/angular-rspack-compiler/src",
5555
"projectType": "library",
5656
"name": "angular-rspack-compiler",
57+
"tags": [
58+
"publishable"
59+
],
5760
"targets": {
5861
"code-pushup": {},
5962
"integration-test": {

Diff for: packages/angular-rspack/.npmignore

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
!dist
22
dist/tsconfig.lib.tsbuildinfo
3+
code-pushup.config.ts
4+
eslint.next.config.js
35
eslint.config.js
46
project.json
57
tsconfig.json
@@ -9,3 +11,5 @@ vite.config.ts
911
src/**/*.ts
1012
!src/lib/patch
1113
.swcrc
14+
vitest.config.mts
15+
vitest.integration.config.mts

Diff for: packages/angular-rspack/package.json

+3
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@
7171
"name": "angular-rspack",
7272
"sourceRoot": "packages/angular-rspack/src",
7373
"projectType": "library",
74+
"tags": [
75+
"publishable"
76+
],
7477
"targets": {
7578
"code-pushup": {},
7679
"unit-test": {

Diff for: packages/build/package.json

+3
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@
6464
"name": "build",
6565
"sourceRoot": "packages/build/src",
6666
"projectType": "library",
67+
"tags": [
68+
"publishable"
69+
],
6770
"targets": {
6871
"code-pushup": {}
6972
}

Diff for: packages/compiler/package.json

+3
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@
5555
"sourceRoot": "packages/compiler/src",
5656
"projectType": "library",
5757
"name": "compiler",
58+
"tags": [
59+
"publishable"
60+
],
5861
"targets": {
5962
"code-pushup": {},
6063
"integration-test": {

Diff for: packages/rsbuild-plugin-angular/package.json

+3
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@
4545
"sourceRoot": "packages/rsbuild-plugin-angular/src",
4646
"projectType": "library",
4747
"name": "rsbuild-plugin-angular",
48+
"tags": [
49+
"publishable"
50+
],
4851
"targets": {
4952
"integration-test": {
5053
"dependsOn": [

0 commit comments

Comments
 (0)