Skip to content

Commit fccaf96

Browse files
committed
adapt publish
1 parent f2c5c95 commit fccaf96

File tree

3 files changed

+18
-121
lines changed

3 files changed

+18
-121
lines changed

.github/workflows/build.yml

-21
Original file line numberDiff line numberDiff line change
@@ -336,25 +336,4 @@ jobs:
336336
npm whoami
337337
if [[ "$GITHUB_EVENT_NAME" == "schedule" ]]; then
338338
npm publish --tag alpha
339-
else
340-
npm publish
341339
fi
342-
343-
publish-github:
344-
name: Publish GitHub release
345-
needs:
346-
- test
347-
- ember-try
348-
- build
349-
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
350-
runs-on: ubuntu-latest
351-
steps:
352-
- name: Create release
353-
uses: actions/create-release@v1
354-
env:
355-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
356-
with:
357-
tag_name: ${{ github.ref }}
358-
release_name: ${{ github.ref }}
359-
draft: false
360-
prerelease: false

.github/workflows/publish.yml

+17-100
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
push:
1010
branches:
1111
- main
12+
- master
1213

1314
concurrency:
1415
group: publish-${{ github.head_ref || github.ref }}
@@ -31,111 +32,27 @@ jobs:
3132
# plus the fact that this action only runs on main will be enough of a guard
3233
- id: check-release
3334
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
5635

57-
publish-chrome:
58-
name: Publish Chrome extension
59-
needs: check-plan
36+
publish:
37+
name: "NPM Publish"
6038
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'
8741

88-
publish-firefox:
89-
name: Publish Firefox extension
90-
needs:
91-
- check-plan
92-
runs-on: ubuntu-latest
9342
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
10345
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'
11349

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
12451
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
13156
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 }}

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"test": "tests"
1111
},
1212
"scripts": {
13+
"prepublishOnly": "node -e 'process.exit(!require(\"fs\").existsSync(\"./dist\"))' || pnpm build:production",
1314
"build": "ember build",
1415
"build:production": "EMBER_ENV=production node scripts/download-panes.js && ember build --environment production && gulp compress:chrome && gulp compress:firefox && gulp clean-tmp",
1516
"changelog": "github_changelog_generator -u emberjs -p ember-inspector --since-tag v3.8.0",

0 commit comments

Comments
 (0)