Skip to content

Commit d1598b6

Browse files
chore: add more env vars for publishing [EXT-7081] (#2874)
* chore: add more env vars for publishing [EXT-7081] * chore: publish to github and mirror scoped packages * chore: add publish package permission
1 parent 8395e08 commit d1598b6

4 files changed

Lines changed: 30 additions & 1 deletion

File tree

.github/workflows/release.yaml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
contents: write
2020
id-token: write
2121
actions: read
22+
packages: write
2223

2324
steps:
2425
- name: Retrieve Secrets from Vault
@@ -31,7 +32,8 @@ jobs:
3132
path: github-actions
3233
exportEnv: false
3334
secrets: |
34-
github/token/${{ github.event.repository.name }}-semantic-release token | GITHUB_TOKEN;
35+
secret/data/github/github_packages_write GITHUB_PACKAGES_WRITE_TOKEN | GITHUB_PACKAGES_WRITE_TOKEN;
36+
github/token/${{ github.event.repository.name }}-semantic-release token | GITHUB_TOKEN ;
3537
secret/data/github/automation-app-user GH_USER_NAME | GIT_COMMITTER_NAME ;
3638
secret/data/github/automation-app-user GH_USER_EMAIL | GIT_COMMITTER_EMAIL ;
3739
@@ -81,27 +83,51 @@ jobs:
8183
env:
8284
GITHUB_TOKEN: ${{ steps.vault.outputs.GITHUB_TOKEN }}
8385
GH_TOKEN: ${{ steps.vault.outputs.GITHUB_TOKEN }}
86+
NPM_TOKEN: ${{ steps.vault.outputs.GITHUB_PACKAGES_WRITE_TOKEN }}
87+
NODE_AUTH_TOKEN: ${{ steps.vault.outputs.GITHUB_PACKAGES_WRITE_TOKEN }}
88+
GIT_AUTHOR_NAME: ${{ steps.vault.outputs.GIT_COMMITTER_NAME }}
89+
GIT_AUTHOR_EMAIL: ${{ steps.vault.outputs.GIT_COMMITTER_EMAIL }}
90+
GIT_COMMITTER_NAME: ${{ steps.vault.outputs.GIT_COMMITTER_NAME }}
91+
GIT_COMMITTER_EMAIL: ${{ steps.vault.outputs.GIT_COMMITTER_EMAIL }}
8492

8593
- name: Publish (main branch)
8694
if: (github.event.workflow_run.head_branch || github.ref_name) == 'main'
8795
run: npm run publish-packages
8896
env:
8997
GITHUB_TOKEN: ${{ steps.vault.outputs.GITHUB_TOKEN }}
9098
GH_TOKEN: ${{ steps.vault.outputs.GITHUB_TOKEN }}
99+
NPM_TOKEN: ${{ steps.vault.outputs.GITHUB_PACKAGES_WRITE_TOKEN }}
100+
NODE_AUTH_TOKEN: ${{ steps.vault.outputs.GITHUB_PACKAGES_WRITE_TOKEN }}
101+
GIT_AUTHOR_NAME: ${{ steps.vault.outputs.GIT_COMMITTER_NAME }}
102+
GIT_AUTHOR_EMAIL: ${{ steps.vault.outputs.GIT_COMMITTER_EMAIL }}
103+
GIT_COMMITTER_NAME: ${{ steps.vault.outputs.GIT_COMMITTER_NAME }}
104+
GIT_COMMITTER_EMAIL: ${{ steps.vault.outputs.GIT_COMMITTER_EMAIL }}
91105

92106
- name: Version (canary branch)
93107
if: (github.event.workflow_run.head_branch || github.ref_name) == 'canary'
94108
run: npm run version:canary
95109
env:
96110
GITHUB_TOKEN: ${{ steps.vault.outputs.GITHUB_TOKEN }}
97111
GH_TOKEN: ${{ steps.vault.outputs.GITHUB_TOKEN }}
112+
NPM_TOKEN: ${{ steps.vault.outputs.GITHUB_PACKAGES_WRITE_TOKEN }}
113+
NODE_AUTH_TOKEN: ${{ steps.vault.outputs.GITHUB_PACKAGES_WRITE_TOKEN }}
114+
GIT_AUTHOR_NAME: ${{ steps.vault.outputs.GIT_COMMITTER_NAME }}
115+
GIT_AUTHOR_EMAIL: ${{ steps.vault.outputs.GIT_COMMITTER_EMAIL }}
116+
GIT_COMMITTER_NAME: ${{ steps.vault.outputs.GIT_COMMITTER_NAME }}
117+
GIT_COMMITTER_EMAIL: ${{ steps.vault.outputs.GIT_COMMITTER_EMAIL }}
98118

99119
- name: Publish (canary branch)
100120
if: (github.event.workflow_run.head_branch || github.ref_name) == 'canary'
101121
run: npm run publish-packages:canary
102122
env:
103123
GITHUB_TOKEN: ${{ steps.vault.outputs.GITHUB_TOKEN }}
104124
GH_TOKEN: ${{ steps.vault.outputs.GITHUB_TOKEN }}
125+
NPM_TOKEN: ${{ steps.vault.outputs.GITHUB_PACKAGES_WRITE_TOKEN }}
126+
NODE_AUTH_TOKEN: ${{ steps.vault.outputs.GITHUB_PACKAGES_WRITE_TOKEN }}
127+
GIT_AUTHOR_NAME: ${{ steps.vault.outputs.GIT_COMMITTER_NAME }}
128+
GIT_AUTHOR_EMAIL: ${{ steps.vault.outputs.GIT_COMMITTER_EMAIL }}
129+
GIT_COMMITTER_NAME: ${{ steps.vault.outputs.GIT_COMMITTER_NAME }}
130+
GIT_COMMITTER_EMAIL: ${{ steps.vault.outputs.GIT_COMMITTER_EMAIL }}
105131

106132
- name: Print lerna debug log
107133
if: always()

packages/contentful--app-scripts/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"lib"
4545
],
4646
"publishConfig": {
47+
"registry": "https://npm.pkg.github.com/",
4748
"access": "public"
4849
},
4950
"dependencies": {

packages/contentful--create-contentful-app/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
"lib"
5656
],
5757
"publishConfig": {
58+
"registry": "https://npm.pkg.github.com/",
5859
"access": "public"
5960
},
6061
"devDependencies": {

packages/contentful--react-apps-toolkit/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"typescript": "4.9.5"
4848
},
4949
"publishConfig": {
50+
"registry": "https://npm.pkg.github.com/",
5051
"access": "public"
5152
},
5253
"dependencies": {

0 commit comments

Comments
 (0)