feat: Update CDN Bundles for v10.7.0 (#93) #98
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build & Publish | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Volta & Node | |
uses: volta-cli/action@v4 | |
- run: yarn install --immutable | |
- name: Fetch next version | |
uses: mathieudutour/github-tag-action@v6.2 | |
id: find_version | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
release_branches: main | |
dry_run: true | |
- name: Set package.json version to ${{ steps.find_version.outputs.new_tag }} | |
run: > | |
cp package.json tmp.json; | |
jq -r '.version |= "${{ steps.find_version.outputs.new_version }}"' tmp.json > package.json; | |
rm -rf tmp.json | |
- name: Set manifest.json version to ${{ steps.find_version.outputs.new_tag }} | |
run: > | |
cp src/manifest.json tmp.json; | |
jq -r '.version |= "${{ steps.find_version.outputs.new_version }}"' tmp.json > src/manifest.json; | |
rm -rf tmp.json | |
- name: Build Chrome extension into dist/ | |
run: yarn run build && mkdir -p extension | |
- name: Bundle Chrome extension into extension/chrome.zip | |
uses: montudor/action-zip@v1 | |
with: | |
args: zip -qq -r extension/chrome.zip dist | |
- uses: actions/upload-artifact@v4.3.6 | |
with: | |
name: extensions | |
path: extension/ | |
package: | |
needs: build | |
runs-on: ubuntu-latest | |
outputs: | |
new_tag: ${{ steps.tag_version.outputs.new_tag }} | |
steps: | |
- name: Set up Volta & Node | |
uses: volta-cli/action@v4 | |
- uses: actions/download-artifact@v4.1.8 | |
with: | |
name: extensions | |
path: extension/ | |
- name: Bump version and push tag | |
uses: mathieudutour/github-tag-action@v6.2 | |
id: tag_version | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
release_branches: main | |
- name: Create GitHub release tag ${{ steps.tag_version.outputs.new_tag }} | |
uses: ncipollo/release-action@v1 | |
with: | |
tag: ${{ steps.tag_version.outputs.new_tag }} | |
name: Release ${{ steps.tag_version.outputs.new_tag }} | |
body: ${{ steps.tag_version.outputs.changelog }} | |
artifacts: extension/chrome.zip | |
upload: | |
needs: package | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
command: | |
- chrome | |
steps: | |
- name: Set up Volta & Node | |
uses: volta-cli/action@v4 | |
- uses: actions/download-artifact@v4.1.8 | |
with: | |
name: extensions | |
path: extension/ | |
- name: Submit to Google | |
if: matrix.command == 'chrome' | |
run: npx chrome-webstore-upload-cli@2 upload --auto-publish --source extension/chrome.zip | |
env: | |
EXTENSION_ID: ${{ secrets.CHROME_EXTENSION_ID }} | |
CLIENT_ID: ${{ secrets.CHROME_CLIENT_ID }} | |
CLIENT_SECRET: ${{ secrets.CHROME_CLIENT_SECRET }} | |
REFRESH_TOKEN: ${{ secrets.CHROME_REFRESH_TOKEN }} |