Skip to content

Commit f3ad161

Browse files
authored
Update release.yml
1 parent 9f91208 commit f3ad161

File tree

1 file changed

+43
-38
lines changed

1 file changed

+43
-38
lines changed

.github/workflows/release.yml

Lines changed: 43 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,68 @@
11
env:
22
DIRECTORY: src
3+
PROJECT_NAME: contributors-on-github
34

45
# FILE GENERATED WITH: npx ghat fregante/ghatemplates/webext
56
# SOURCE: https://github.com/fregante/ghatemplates
6-
# OPTIONS: {"set":["on.schedule=[{\"cron\": \"41 12 1 * *\"}]"]}
77

88
name: Release
99
on:
1010
workflow_dispatch: null
11-
schedule:
12-
- cron: 41 12 1 * *
1311
jobs:
1412
Version:
1513
outputs:
16-
created: ${{ steps.daily-version.outputs.created }}
17-
version: ${{ steps.daily-version.outputs.version }}
14+
created: ${{ env.DAILY_VERSION_CREATED }}
1815
runs-on: ubuntu-latest
1916
steps:
20-
- uses: actions/checkout@v2
17+
- uses: actions/checkout@v4
18+
- name: Create tag if necessary
19+
uses: fregante/daily-version-action@v2
20+
- name: Update manifest.json with version ${{ env.DAILY_VERSION}}
21+
if: env.DAILY_VERSION_CREATED
22+
run: npx dot-json@1 "$DIRECTORY/manifest.json" version "$DAILY_VERSION"
23+
- name: Ready for "submit" jobs
24+
if: env.DAILY_VERSION_CREATED
25+
uses: actions/upload-artifact@v4
2126
with:
22-
fetch-depth: 20
23-
- uses: fregante/daily-version-action@v2
24-
name: Create tag if necessary
25-
id: daily-version
26-
- uses: fregante/release-with-changelog@v3
27-
if: steps.daily-version.outputs.created
28-
with:
29-
token: ${{ secrets.GITHUB_TOKEN }}
30-
exclude: true
31-
Submit:
27+
path: ${{ env.DIRECTORY }}
28+
- name: Create release
29+
if: env.DAILY_VERSION_CREATED
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
working-directory: ${{ env.DIRECTORY }}
33+
run: |
34+
FILENAME="$PROJECT_NAME-$DAILY_VERSION-for-local-testing-only.zip"
35+
zip -r "$FILENAME" ./*
36+
# Create as draft to curate it before sending it out
37+
gh release create "$DAILY_VERSION" "$FILENAME" --draft --generate-notes
38+
Chrome:
39+
if: needs.Version.outputs.created
3240
needs: Version
33-
if: github.event_name == 'workflow_dispatch' || needs.Version.outputs.created
34-
strategy:
35-
fail-fast: false
36-
matrix:
37-
command:
38-
- firefox
39-
- chrome
41+
name: Submit (Chrome)
42+
environment: Chrome
4043
runs-on: ubuntu-latest
4144
steps:
42-
- uses: actions/checkout@v2
43-
- name: Update extension’s meta
44-
run: >-
45-
npx dot-json@1 $DIRECTORY/manifest.json version ${{
46-
needs.Version.outputs.version }}
47-
- name: Submit
48-
run: |
49-
case ${{ matrix.command }} in
50-
chrome)
51-
cd $DIRECTORY && npx chrome-webstore-upload-cli@3 upload --auto-publish
52-
;;
53-
firefox)
54-
cd $DIRECTORY && npx web-ext@8
55-
;;
56-
esac
45+
- uses: actions/checkout@v4
46+
- uses: actions/download-artifact@v4
47+
- run: npx chrome-webstore-upload-cli@3
48+
working-directory: artifact
5749
env:
5850
EXTENSION_ID: ${{ secrets.EXTENSION_ID }}
5951
CLIENT_ID: ${{ secrets.CLIENT_ID }}
6052
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
6153
REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }}
54+
Firefox:
55+
if: needs.Version.outputs.created
56+
needs: Version
57+
name: Submit (Firefox)
58+
environment: Firefox
59+
runs-on: ubuntu-latest
60+
steps:
61+
- uses: actions/checkout@v4
62+
- uses: actions/download-artifact@v4
63+
- name: Upload build and source code
64+
run: npx web-ext@8 sign --channel listed
65+
working-directory: artifact
66+
env:
6267
WEB_EXT_API_KEY: ${{ secrets.WEB_EXT_API_KEY }}
6368
WEB_EXT_API_SECRET: ${{ secrets.WEB_EXT_API_SECRET }}

0 commit comments

Comments
 (0)