From 975534c8a832e2ef4e03d5b7d65d9ff4e9a9d7e0 Mon Sep 17 00:00:00 2001 From: Federico Date: Mon, 19 Oct 2020 22:42:46 -0500 Subject: [PATCH 1/8] Meta: update release workflow --- .github/workflows/deployment.yml | 75 +++++++++++++++----------------- 1 file changed, 36 insertions(+), 39 deletions(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 28d03c7..31ad8a9 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -1,56 +1,53 @@ -# Copied from https://github.com/notlmn/browser-extension-template/blob/master/.github/workflows/deployment.yml -name: Deployment +# Copied from https://github.com/notlmn/browser-extension-template/blob/master/.github/workflows/release.yml +name: Release on: + workflow_dispatch: + # You can manually trigger a deployment on GitHub.com + # https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/ schedule: - - cron: '22 14 * * 3' # At 14:22 on Wednesday https://crontab.guru/#22_14_*_*_3 - push: - tags: - - "20.*" - - "21.*" - - "22.*" - - "23.*" - - "24.*" + - cron: '22 14 * * 3' jobs: - Version: - runs-on: ubuntu-latest outputs: - version: ${{ steps.daily-version.outputs.version }} created: ${{ steps.daily-version.outputs.created }} + version: ${{ steps.daily-version.outputs.version }} + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + with: + fetch-depth: 20 + - run: npm install + - run: npm test - uses: fregante/daily-version-action@v1 name: Create tag if necessary id: daily-version + - uses: notlmn/release-with-changelog@v3 + if: steps.daily-version.outputs.created + with: + token: ${{ secrets.GITHUB_TOKEN }} + exclude: '^Meta|^Document|^Readme|^Lint' - Build: + Submit: needs: Version - if: github.event_name == 'push' || needs.Version.outputs.created - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - run: npm install - - run: npm test - - name: Update extension’s meta - env: - VER: ${{ needs.Version.outputs.version }} - run: | - echo https://github.com/$GITHUB_REPOSITORY/tree/$VER > distribution/SOURCE_URL.txt - npm run version - - uses: actions/upload-artifact@v2 - with: - path: distribution - - Chrome: - needs: Build + if: github.event_name == 'workflow_dispatch' || needs.Build.outputs.created + strategy: + matrix: + command: + - firefox + - chrome runs-on: ubuntu-latest steps: - - uses: actions/download-artifact@v2 - - run: cd artifact && npx chrome-webstore-upload-cli@1 upload --auto-publish - env: - EXTENSION_ID: ${{ secrets.EXTENSION_ID }} - CLIENT_ID: ${{ secrets.CLIENT_ID }} - CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }} - REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }} + - run: npm install + - run: npm run build + - name: Update extension’s meta + run: npx dot-json distribution/manifest.json version ${{ steps.daily-version.outputs.version }} + - run: npm run release:${{ matrix.command }} + 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 }} From 767e02be39bcc1e200028a2bcfacc4991a5833b1 Mon Sep 17 00:00:00 2001 From: Federico Date: Mon, 19 Oct 2020 22:59:58 -0500 Subject: [PATCH 2/8] Rename deployment.yml to release.yml --- .github/workflows/{deployment.yml => release.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{deployment.yml => release.yml} (100%) diff --git a/.github/workflows/deployment.yml b/.github/workflows/release.yml similarity index 100% rename from .github/workflows/deployment.yml rename to .github/workflows/release.yml From 632b165c9a57bbdde15fa19f2b06977ffb5beda8 Mon Sep 17 00:00:00 2001 From: Federico Date: Mon, 19 Oct 2020 23:02:22 -0500 Subject: [PATCH 3/8] Remove outdated npm scripts --- package.json | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 9db07f8..e7696bd 100644 --- a/package.json +++ b/package.json @@ -6,10 +6,8 @@ "lint": "run-p lint:*", "lint:css": "stylelint 'source/*.css'", "lint:js": "eslint source --ext svelte", - "release:cws": "webstore upload --source=distribution --auto-publish", - "release": "VER=$(daily-version) run-s build version release:*", - "test": "run-p 'lint:*' build", - "version": "dot-json distribution/manifest.json version $VER", + "release:chrome": "cd distribution && webstore upload --auto-publish", + "test": "run-p lint:* build", "watch": "rollup --config --watch" }, "eslintConfig": { From c24d53e2c2ac48b0d590fa7aed21dee716d8901d Mon Sep 17 00:00:00 2001 From: Federico Date: Mon, 19 Oct 2020 23:05:09 -0500 Subject: [PATCH 4/8] Use exclude preset from `release-with-changelog` --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 31ad8a9..def0d74 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,7 +27,7 @@ jobs: if: steps.daily-version.outputs.created with: token: ${{ secrets.GITHUB_TOKEN }} - exclude: '^Meta|^Document|^Readme|^Lint' + exclude: true Submit: needs: Version From 761144fb890a8b530becee39082c3633e413219b Mon Sep 17 00:00:00 2001 From: Federico Date: Mon, 19 Oct 2020 23:26:49 -0500 Subject: [PATCH 5/8] Fix workflow --- .github/workflows/release.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index def0d74..6c3b065 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,18 +31,20 @@ jobs: Submit: needs: Version - if: github.event_name == 'workflow_dispatch' || needs.Build.outputs.created + if: github.event_name == 'workflow_dispatch' || needs.Version.outputs.created strategy: + fail-fast: false matrix: command: - firefox - chrome runs-on: ubuntu-latest steps: + - uses: actions/checkout@v2 - run: npm install - run: npm run build - name: Update extension’s meta - run: npx dot-json distribution/manifest.json version ${{ steps.daily-version.outputs.version }} + run: npx dot-json distribution/manifest.json version ${{ needs.Version.outputs.version }} - run: npm run release:${{ matrix.command }} env: EXTENSION_ID: ${{ secrets.EXTENSION_ID }} From 64e4a2f0adb2018801d80eedadf4109a87606f45 Mon Sep 17 00:00:00 2001 From: Federico Brigante Date: Sun, 8 Nov 2020 01:36:33 -0600 Subject: [PATCH 6/8] Use `ghat` https://github.com/fregante/ghat --- .github/workflows/release.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6c3b065..b960ac9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,3 +1,7 @@ +env: +# Generated by `npx ghat notlmn/browser-extension-template/.github/workflows/release.yml` +# DO NOT EDIT BELOW + # Copied from https://github.com/notlmn/browser-extension-template/blob/master/.github/workflows/release.yml name: Release From b3c26411ec4e53d8c6e9296fddba23a3c1d61596 Mon Sep 17 00:00:00 2001 From: Federico Brigante Date: Sun, 27 Dec 2020 00:16:59 -0600 Subject: [PATCH 7/8] Update again --- .github/workflows/release.yml | 46 +++++++++++++++++------------------ 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b960ac9..e570338 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,28 +1,24 @@ -env: -# Generated by `npx ghat notlmn/browser-extension-template/.github/workflows/release.yml` -# DO NOT EDIT BELOW +env: {} -# Copied from https://github.com/notlmn/browser-extension-template/blob/master/.github/workflows/release.yml -name: Release +# DO NOT EDIT BELOW, USE: npx ghat fregante/ghatemplates/webext --set 'on.schedule=[{"cron": "22 14 * * 3"}]' +name: Release on: - workflow_dispatch: - # You can manually trigger a deployment on GitHub.com - # https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/ + workflow_dispatch: null schedule: - - cron: '22 14 * * 3' - + - cron: 22 14 * * 3 jobs: Version: outputs: - created: ${{ steps.daily-version.outputs.created }} - version: ${{ steps.daily-version.outputs.version }} + created: '${{ steps.daily-version.outputs.created }}' + version: '${{ steps.daily-version.outputs.version }}' runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 with: fetch-depth: 20 - - run: npm install + - name: install + run: npm ci || npm install - run: npm test - uses: fregante/daily-version-action@v1 name: Create tag if necessary @@ -30,9 +26,8 @@ jobs: - uses: notlmn/release-with-changelog@v3 if: steps.daily-version.outputs.created with: - token: ${{ secrets.GITHUB_TOKEN }} + token: '${{ secrets.GITHUB_TOKEN }}' exclude: true - Submit: needs: Version if: github.event_name == 'workflow_dispatch' || needs.Version.outputs.created @@ -45,15 +40,18 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - run: npm install + - name: install + run: npm ci || npm install - run: npm run build - name: Update extension’s meta - run: npx dot-json distribution/manifest.json version ${{ needs.Version.outputs.version }} - - run: npm run release:${{ matrix.command }} + run: >- + npx dot-json distribution/manifest.json version ${{ + needs.Version.outputs.version }} + - run: 'npm run release:${{ matrix.command }}' 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 }} + 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 }}' From 9add7685b2e3828ddd38b8e71e0c3896ff79171e Mon Sep 17 00:00:00 2001 From: Federico Brigante Date: Sun, 27 Dec 2020 00:18:44 -0600 Subject: [PATCH 8/8] Remove Firefox --- .github/workflows/release.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e570338..906c6d2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,6 +1,6 @@ env: {} -# DO NOT EDIT BELOW, USE: npx ghat fregante/ghatemplates/webext --set 'on.schedule=[{"cron": "22 14 * * 3"}]' +# DO NOT EDIT BELOW, USE: npx ghat fregante/ghatemplates/webext --set 'on.schedule=[{"cron": "22 14 * * 3"}]' --set 'jobs.Submit.strategy.matrix.command=["chrome"]' name: Release on: @@ -35,7 +35,6 @@ jobs: fail-fast: false matrix: command: - - firefox - chrome runs-on: ubuntu-latest steps: