Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 24 additions & 35 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ on:
jobs:
Version:
outputs:
created: ${{ steps.daily-version.outputs.created }}
version: ${{ steps.daily-version.outputs.version }}
created: ${{ env.DAILY_VERSION_CREATED }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -22,21 +21,25 @@ jobs:
with:
node-version-file: '.nvmrc'
cache: npm
- name: install
run: npm ci || npm install
- run: npm test
- uses: fregante/daily-version-action@v1
- run: npm ci
- name: Test and build
run: npm test
- uses: fregante/daily-version-action@v2
name: Create tag if necessary
id: daily-version
- if: steps.daily-version.outputs.created
- name: Update extension’s meta
run: npx dot-json@1 $DIRECTORY/manifest.json version $DAILY_VERSION
- uses: actions/upload-artifact@v3
with:
name: built
path: ${{ env.DIRECTORY }}
- if: env.DAILY_VERSION_CREATED
name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
working-directory: ${{ env.DIRECTORY }}
run: |
cd distribution
zip -r refined-github-local-install.zip *
gh release create "${{ steps.daily-version.outputs.version }}" --generate-notes refined-github-local-install.zip

gh release create "$DAILY_VERSION" --generate-notes refined-github-local-install.zip

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
gh release create "$DAILY_VERSION" --generate-notes refined-github-local-install.zip
gh release create "$DAILY_VERSION" --latest --generate-notes refined-github-local-install.zip


Submit:
needs: Version
Expand All @@ -49,32 +52,18 @@ jobs:
- chrome
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: npm
- name: install
run: npm ci || npm install
- run: npm run build --if-present
- name: Update extension’s meta
run: >-
npx dot-json@1 $DIRECTORY/manifest.json version ${{
needs.Version.outputs.version }}
- name: Submit
run: |
case ${{ matrix.command }} in
chrome)
cd $DIRECTORY && npx chrome-webstore-upload-cli@2 upload --auto-publish
;;
firefox)
cd $DIRECTORY && npx web-ext-submit@7
;;
esac
- uses: actions/download-artifact@v3
- name: Submit to Mozilla
if: matrix.command === 'firefox'
run: cd artifacts/built && npx web-ext-submit@7
env:
WEB_EXT_API_KEY: ${{ secrets.WEB_EXT_API_KEY }}
WEB_EXT_API_SECRET: ${{ secrets.WEB_EXT_API_SECRET }}
- name: Submit to Google
if: matrix.command === 'chrome'
run: cd artifacts/built && npx chrome-webstore-upload-cli@2 upload --auto-publish
env:
EXTENSION_ID: ${{ secrets.EXTENSION_ID }}
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }}
WEB_EXT_API_KEY: ${{ secrets.WEB_EXT_API_KEY }}
WEB_EXT_API_SECRET: ${{ secrets.WEB_EXT_API_SECRET }}