Skip to content

Commit 41f3383

Browse files
committed
Fix publish workflow
1 parent ea59f5f commit 41f3383

File tree

1 file changed

+35
-24
lines changed

1 file changed

+35
-24
lines changed

.github/workflows/publish.yml

Lines changed: 35 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,56 +7,67 @@ on:
77
release:
88
types: [published]
99

10+
env:
11+
VERSION: ${{ github.event.release.tag_name }}
12+
1013
jobs:
1114
publish:
1215
runs-on: ubuntu-latest
1316
steps:
1417
- uses: actions/checkout@v4
18+
1519
- uses: actions/setup-node@v4
1620
with:
1721
node-version: "22"
22+
1823
- name: Generate source archive
1924
run: npm run archive
20-
env:
21-
VERSION: ${{ github.event.release.tag_name }}
25+
26+
- name: Upload source archive
27+
uses: actions/upload-artifact@v4
28+
with:
29+
name: codecov-browser-extension-${{ github.event.release.tag_name }}.tar.gz
30+
path: codecov-browser-extension-${{ github.event.release.tag_name }}.tar.gz
31+
2232
- name: Install dependencies
23-
run: npm ci
24-
- name: Build extension
33+
run: npm install
34+
35+
- name: Build Chrome extension
2536
run: npm run build
2637
env:
2738
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
28-
VERSION: ${{ github.event.release.tag_name }}
29-
- name: Prepare Firefox extension
30-
run: |
31-
cp -r dist dist-chrome
32-
mv dist/manifest.firefox.json dist/manifest.json
33-
npm run set-version
34-
mv dist dist-firefox
39+
3540
- name: Upload built Chrome extension
3641
uses: actions/upload-artifact@v4
3742
with:
3843
name: codecov-chrome-${{ github.event.release.tag_name }}
39-
path: ./dist-chrome/
40-
- name: Upload built Firefox extension
41-
uses: actions/upload-artifact@v4
42-
with:
43-
name: codecov-firefox-${{ github.event.release.tag_name }}
44-
path: ./dist-firefox/
45-
- name: Upload source archive
46-
uses: actions/upload-artifact@v4
47-
with:
48-
name: codecov-browser-extension-${{ github.event.release.tag_name }}.tar.gz
49-
path: codecov-browser-extension-${{ github.event.release.tag_name }}.tar.gz
44+
path: ./dist/
45+
5046
- name: Publish to Chrome
51-
working-directory: dist-chrome
47+
working-directory: dist
5248
run: npx chrome-webstore-upload-cli@3
5349
env:
5450
EXTENSION_ID: "gedikamndpbemklijjkncpnolildpbgo"
5551
CLIENT_ID: ${{ secrets.GOOGLE_WEB_STORE_CLIENT_ID }}
5652
CLIENT_SECRET: ${{ secrets.GOOGLE_WEB_STORE_CLIENT_SECRET }}
5753
REFRESH_TOKEN: ${{ secrets.GOOGLE_WEB_STORE_REFRESH_TOKEN }}
54+
55+
- name: Clean dist
56+
run: rm -r dist
57+
58+
- name: Build Firefox extension
59+
run: npm run build:firefox
60+
env:
61+
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
62+
63+
- name: Upload built Firefox extension
64+
uses: actions/upload-artifact@v4
65+
with:
66+
name: codecov-firefox-${{ github.event.release.tag_name }}
67+
path: ./dist/
68+
5869
- name: Publish to Firefox
59-
working-directory: dist-firefox
70+
working-directory: dist
6071
run: npx web-ext sign
6172
env:
6273
WEB_EXT_API_KEY: ${{ secrets.WEB_EXT_JWT_ISSUER }}

0 commit comments

Comments
 (0)