@@ -25,23 +25,33 @@ jobs:
25
25
name : Release
26
26
if : ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'push' }}
27
27
runs-on : ubuntu-latest
28
+ environment : npm
28
29
steps :
29
30
- name : Checkout
30
- uses : actions/checkout@v3
31
+ uses : actions/checkout@v4
31
32
with :
32
33
fetch-depth : 25
34
+ ref : ${{ github.event.inputs.branch }}
33
35
34
- - name : Install Pnpm
36
+ # Use corepack to install pnpm
37
+ - name : Setup Pnpm
35
38
run : |
39
+ npm install -g corepack@latest --force
36
40
corepack prepare [email protected] --activate
37
41
corepack enable
38
42
39
- - name : Setup Node.js 18
40
- uses : actions/setup-node@v3
43
+ - name : Setup Node.js
44
+ uses : actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
41
45
with :
42
- node-version : ' 18 '
46
+ node-version : 22
43
47
cache : ' pnpm'
44
48
49
+ # Update npm to the latest version to enable OIDC
50
+ - name : Update npm
51
+ run : |
52
+ npm install -g npm@latest
53
+ npm --version
54
+
45
55
- name : Install deps
46
56
run : pnpm install
47
57
@@ -52,15 +62,17 @@ jobs:
52
62
npx nx run-many --targets=build --projects=tag:type:metro
53
63
ls -l packages/*/dist packages/*/package.json
54
64
55
- - name : Release
56
- uses : module-federation/actions@v2
65
+ - uses : actions/github-script@v7
66
+ id : version_to_release
57
67
with :
58
- version : ${{ github.event.inputs.version || 'next' }}
59
- branch : ${{ github.event.inputs.branch }}
60
- type : ' release'
61
- tools : ' changeset'
62
- env :
63
- GITHUB_TOKEN : ${{ secrets.REPO_SCOPED_TOKEN }}
64
- NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
65
- REPOSITORY : ${{ github.repository }}
66
- REF : ${{ github.ref }}
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
+
74
+ - name : Publish to npm
75
+ run : |
76
+ git tag ${{ steps.version_to_release.outputs.result }}
77
+ git push origin ${{ steps.version_to_release.outputs.result }}
78
+ pnpm -r publish --tag ${{ github.event.inputs.npm_tag }} --publish-branch ${{ github.event.inputs.branch }}
0 commit comments