Skip to content

Commit 9c1db66

Browse files
authored
chore(ci): add trusted publishing (#1016)
1 parent 97c3a40 commit 9c1db66

File tree

3 files changed

+41
-30
lines changed

3 files changed

+41
-30
lines changed

.circleci/config.yml

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -183,25 +183,6 @@ jobs:
183183
- store_artifacts:
184184
path: ./artifacts
185185

186-
publish:
187-
executor:
188-
name: rn/linux_js
189-
node_version: 'lts'
190-
resource_class: large
191-
steps:
192-
- checkout
193-
# - rn/yarn_install
194-
# fails with Error untarring cache: Error extracting tarball /var/folders/bq/mjrgbpkx5h1g_b22fpv0tlzc0000gn/T/cache376822577 : tmp/yarn/: Cannot extract through symlink tmp/yarn tmp/yarn/v6/: Cannot extract through symlink tmp/yarn/v6 tmp/yarn/v6/.tmp/: Cannot extract through symlink tmp/yarn/v6/.tmp tmp/yarn/v6/npm-@babel-code-frame-7.8.3-33e25903d7481181534e12ec0a25f16b6fcf419e-integrity/: Cannot extract through symlink tmp/yarn/v6/npm-@babel-code-frame-7.8.3-33e25903d7481181534e12ec0a25f16b6fcf419e-integrity tmp/yarn/v6/npm-@babel-code-frame-7.8.3-33e25903d7481181534e12ec0a25f16b6fcf419e-integrity/node_modules/: Cannot extract through symlink tmp/yarn/v6/npm-@babel-code-frame-7.8.3-33e25903d7481181534e12ec0a25f16b6fcf419e-integrity/node_modules tmp/yarn/v6/npm-@babel-code-frame-7.8.3-33e25903d7481181534e12ec0a25f16b6fcf419e-integrity/node_modules/@babel/: Cannot extract through symlink tmp/yarn/v6/npm-@babel-code-frame-7.8.3-33e25903d7481181534e12ec0a25f16b6fcf419e-integrity/node_modules/@babel tmp/yarn/v6/npm-@babel-code-frame-7.8.3-33e25903d7481181534e12ec0a25f16b6fcf419e-integrity/node_modules/@babel/code-frame/: Cannot extract: exit status 1
195-
- run:
196-
command: yarn install --immutable
197-
name: yarn install
198-
- run:
199-
command: yarn plugin:build
200-
name: build expo config plugin
201-
- run:
202-
command: npx semantic-release
203-
name: Publish to NPM
204-
205186
workflows:
206187
test:
207188
jobs:
@@ -210,13 +191,3 @@ workflows:
210191
- e2e_release_android
211192
- new_arch_android_build_only
212193
- new_arch_ios_build_only
213-
- publish:
214-
requires:
215-
- analyse_js
216-
- e2e_release_android
217-
- e2e_release_ios
218-
- new_arch_android_build_only
219-
- new_arch_ios_build_only
220-
filters:
221-
branches:
222-
only: master

.github/workflows/publish.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: release-please
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
permissions:
9+
id-token: write # Required for kOIDC
10+
contents: write
11+
pull-requests: write
12+
issues: write
13+
14+
jobs:
15+
release-please:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: googleapis/release-please-action@v4
19+
id: release
20+
with:
21+
release-type: node
22+
# The logic below handles the npm publication:
23+
- uses: actions/checkout@v4
24+
# these if statements ensure that a publication only occurs when
25+
# a new release is created:
26+
if: ${{ steps.release.outputs.release_created }}
27+
- uses: actions/setup-node@v4
28+
with:
29+
node-version: 22
30+
registry-url: 'https://registry.npmjs.org'
31+
if: ${{ steps.release.outputs.release_created }}
32+
- run: |
33+
yarn install --immutable
34+
yarn plugin:build
35+
if: ${{ steps.release.outputs.release_created }}
36+
- run: |
37+
npm install -g npm@latest
38+
npm publish
39+
if: ${{ steps.release.outputs.release_created }}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
"app.plugin.js"
2222
],
2323
"publishConfig": {
24-
"access": "public"
24+
"access": "public",
25+
"provenance": true
2526
},
2627
"scripts": {
2728
"start": "patch-package && react-native start",

0 commit comments

Comments
 (0)