Skip to content

Commit 0d72f51

Browse files
authored
chore: remove pkg-pr-new (#4072)
1 parent 0064156 commit 0d72f51

File tree

3 files changed

+28
-30
lines changed

3 files changed

+28
-30
lines changed

.github/workflows/preview.yml

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
1-
# https://github.com/stackblitz-labs/pkg.pr.new
21
name: Preview Release
3-
42
on:
53
workflow_dispatch:
6-
inputs:
7-
branch:
8-
description: 'Release preview version branch (confirm release branch)'
9-
required: true
10-
default: 'main'
4+
branch:
5+
description: 'Release Branch (confirm release branch)'
6+
required: true
7+
default: 'main'
118

129
permissions:
13-
contents: read
10+
id-token: write
1411

1512
jobs:
16-
preview:
17-
if: github.repository == 'module-federation/core'
13+
release:
14+
name: Release
15+
if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'push' }}
1816
runs-on: ubuntu-latest
19-
17+
environment: npm
2018
steps:
2119
- name: Checkout
2220
uses: actions/checkout@v4
@@ -46,12 +44,17 @@ jobs:
4644
- name: Install deps
4745
run: pnpm install
4846

47+
- name: Generate preview version
48+
run: |
49+
npx changeset version --snapshot next
50+
4951
- name: Build and test Packages
5052
run: |
5153
git fetch origin main
5254
npx nx run-many --targets=build --projects=tag:type:pkg --skip-nx-cache
55+
npx nx run-many --targets=build --projects=tag:type:metro
5356
ls -l packages/*/dist packages/*/package.json
5457
55-
- name: Publish Preview
58+
- name: Publish to npm
5659
run: |
57-
pnpx pkg-pr-new@0.0.58 publish --compact --pnpm ./packages/* ./packages/bridge/* ./packages/runtime-plugins/*
60+
pnpm -r publish --tag next

.github/workflows/release.yml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,10 @@ on:
44
inputs:
55
version:
66
type: choice
7-
description: 'Release Version (next, beta, alpha, latest)'
7+
description: 'Release Version (latest)'
88
required: true
9-
default: 'next'
9+
default: 'latest'
1010
options:
11-
- next
12-
- beta
13-
- alpha
1411
- latest
1512
branch:
1613
description: 'Release Branch (confirm release branch)'
@@ -55,22 +52,17 @@ jobs:
5552
- name: Install deps
5653
run: pnpm install
5754

55+
- name: Build & publish (next → preview)
56+
if: github.event.inputs.version == 'next'
57+
run: |
58+
5859
- name: Build and test Packages
5960
run: |
6061
git fetch origin main
6162
npx nx run-many --targets=build --projects=tag:type:pkg --skip-nx-cache
6263
npx nx run-many --targets=build --projects=tag:type:metro
6364
ls -l packages/*/dist packages/*/package.json
6465
65-
- uses: actions/github-script@v7
66-
id: version_to_release
67-
with:
68-
result-encoding: string
69-
script: |
70-
const fs = require('fs');
71-
const packageJson = JSON.parse(fs.readFileSync('./packages/runtime/package.json', 'utf8'));
72-
return 'v' + packageJson.version;
73-
7466
- name: Publish to npm
7567
run: |
7668
pnpm -r publish --tag ${{ github.event.inputs.version }} --publish-branch ${{ github.event.inputs.branch }}

CONTRIBUTING.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,21 +127,24 @@ feat(plugin-swc): Add `xxx` config
127127
|____________ Type
128128
```
129129

130+
130131
## Releasing
131132

132133
Repository maintainers can publish a new version of changed packages to npm.
133134

134135
1. Checkout a new release branch, for example `release-v0.19.0`.
135136
2. Run `pnpm changeset version` in the package directory to update the version of each package.
136-
3. Create a pull request, the title should be `relea se v0.19.1`.
137+
3. Create a pull request, the title should be `release v0.19.1`.
137138
4. Run the [release action](https://github.com/module-federation/core/actions/workflows/release.yml) to publish packages to npm.
138139
5. Wait reviewers to approve.
139140
6. Merge the release pull request to `main`.
140141
7. Generate the [release notes](https://github.com/module-federation/core/releases) via GitHub, see [Automatically generated release notes](https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes)
141142

142-
## Release test version
143+
## Release preview version
144+
145+
1. Make sure your branch has added changeset files before releasing the preview version.
146+
2. Run the [preview action](https://github.com/module-federation/core/actions/workflows/preview.yml) to publish preview packages.
143147

144-
1. Run the [preview action](https://github.com/module-federation/core/actions/workflows/preview.yml) to publish preview packages via [pkg-pr-new](https://github.com/stackblitz-labs/pkg.pr.new).
145148

146149

147150
## Release the official version

0 commit comments

Comments
 (0)