9
9
push :
10
10
branches :
11
11
- main
12
+ - master
12
13
13
14
concurrency :
14
15
group : publish-${{ github.head_ref || github.ref }}
@@ -31,111 +32,27 @@ jobs:
31
32
# plus the fact that this action only runs on main will be enough of a guard
32
33
- id : check-release
33
34
run : if git diff --name-only HEAD HEAD~1 | grep -w -q ".release-plan.json"; then echo "command=release"; fi >> $GITHUB_OUTPUT
34
-
35
- publish-bookmarklet :
36
- name : Publish bookmarklet
37
- needs : check-plan
38
- runs-on : ubuntu-latest
39
- steps :
40
- - name : Download artifacts (bookmarklet)
41
- uses : actions/download-artifact@v4
42
- with :
43
- name : bookmarklet
44
- path : bookmarklet
45
- - name : Upload to S3
46
- if : needs.check-plan.outputs.command == 'release'
47
- uses : jakejarvis/s3-sync-action@v0.5.1
48
- with :
49
- args : --acl public-read --cache-control "max-age=86400000,public"
50
- env :
51
- AWS_S3_BUCKET : ember-extension
52
- AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
53
- AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
54
- SOURCE_DIR : bookmarklet
55
- DEST_DIR : dist_bookmarklet
56
35
57
- publish-chrome :
58
- name : Publish Chrome extension
59
- needs : check-plan
36
+ publish :
37
+ name : " NPM Publish"
60
38
runs-on : ubuntu-latest
61
- steps :
62
- - name : Set up node
63
- uses : actions/setup-node@v4
64
- - name : Install dependencies (chrome-webstore-upload-cli)
65
- run : npm install -g chrome-webstore-upload-cli
66
- - name : Download artifacts (Chrome)
67
- uses : actions/download-artifact@v4
68
- with :
69
- name : chrome
70
- path : chrome
71
- - name : Set Environment Variables
72
- run : |
73
- if [[ "$GITHUB_EVENT_NAME" == "schedule" ]]; then
74
- echo "EXTENSION_ID=ibdbkmdgflhglikhjdbogjjflkialpfi" >> $GITHUB_ENV
75
- echo "CLIENT_ID=${{ secrets.GOOGLE_NIGHTLY_CLIENT_ID }}" >> $GITHUB_ENV
76
- echo "REFRESH_TOKEN=${{ secrets.GOOGLE_NIGHTLY_REFRESH_TOKEN }}" >> $GITHUB_ENV
77
- else
78
- echo "EXTENSION_ID=bmdblncegkenkacieihfhpjfppoconhi" >> $GITHUB_ENV
79
- echo "CLIENT_ID=${{ secrets.GOOGLE_STABLE_CLIENT_ID }}" >> $GITHUB_ENV
80
- echo "REFRESH_TOKEN=${{ secrets.GOOGLE_STABLE_REFRESH_TOKEN }}" >> $GITHUB_ENV
81
- fi
82
- - name : Upload to Chrome Web Store
83
- if : >-
84
- github.event_name == 'schedule' ||
85
- needs.check-plan.outputs.command == 'release'
86
- run : chrome-webstore-upload upload --source chrome --auto-publish
39
+ needs : check-plan
40
+ if : needs.check-plan.outputs.command == 'release'
87
41
88
- publish-firefox :
89
- name : Publish Firefox extension
90
- needs :
91
- - check-plan
92
- runs-on : ubuntu-latest
93
42
steps :
94
- - name : Set up nod
95
- uses : actions/setup-node@v4
96
- - name : Install dependencies (web-ext)
97
- run : |
98
- npm install -g web-ext
99
- # https://github.com/mozilla/web-ext/issues/804
100
- npm install -g web-ext-submit
101
- - name : Download artifacts (Firefox)
102
- uses : actions/download-artifact@v4
43
+ - uses : actions/checkout@v4
44
+ - uses : actions/setup-node@v4
103
45
with :
104
- name : firefox
105
- path : firefox
106
- - name : Upload to AMO
107
- if : needs.check-plan.outputs.command == 'release'
108
- working-directory : firefox
109
- run : web-ext-submit --channel=listed
110
- env :
111
- WEB_EXT_API_KEY : ${{ secrets.FIREFOX_API_KEY }}
112
- WEB_EXT_API_SECRET : ${{ secrets.FIREFOX_API_SECRET }}
46
+ node-version : 18
47
+ # This creates an .npmrc that reads the NODE_AUTH_TOKEN environment variable
48
+ registry-url : ' https://registry.npmjs.org'
113
49
114
- publish-npm :
115
- name : Publish npm package
116
- needs :
117
- - check-plan
118
- runs-on : ubuntu-latest
119
- steps :
120
- - name : Set up node
121
- uses : actions/setup-node@v4
122
- - name : Download artifacts (npm)
123
- uses : actions/download-artifact@v4
50
+ - uses : pnpm/action-setup@v2
124
51
with :
125
- name : npm
126
- path : npm
127
- - name : Publish to npm
128
- if : >-
129
- github.event_name == 'schedule' ||
130
- needs.check-plan.outputs.command == 'release'
52
+ version : 8
53
+ - run : pnpm install --frozen-lockfile
54
+ - name : npm publish
55
+ run : pnpm release-plan publish
131
56
env :
132
- NPM_AUTH_TOKEN : ${{ secrets.NPM_AUTH_TOKEN }}
133
- working-directory : npm
134
- run : |
135
- echo "//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}"> ~/.npmrc
136
- npm whoami
137
- if [[ "$GITHUB_EVENT_NAME" == "schedule" ]]; then
138
- pnpm release-plan publish --singlePackage=ember-inspector --tag alpha
139
- else
140
- pnpm release-plan publish --singlePackage=ember-inspector
141
- fi
57
+ GITHUB_AUTH : ${{ secrets.GITHUB_TOKEN }}
58
+ NODE_AUTH_TOKEN : ${{ secrets.NPM_AUTH_TOKEN }}
0 commit comments