Merge pull request #4 from mmz-srf/icons-and-buttons-and-stuff #23
This file contains 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: Update Chrome Extension | |
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#using-filters | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
# building | |
build-chrome-extension: | |
name: Build Chrome extension artifact | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- name: Install & build dist | |
run: npm install && npm run build | |
# .. | |
- name: Zip | |
run: | | |
zip -r chrome-extension-test.zip dist -x '*.git*' | |
# https://github.com/actions/upload-artifact | |
- name: artifact | |
uses: actions/upload-artifact@v4 | |
id: artifact-upload-step | |
with: | |
# Name of the artifact to upload. | |
# Optional. Default is 'artifact' | |
name: my-artifact | |
# A file, directory or wildcard pattern that describes what to upload | |
# Required. | |
path: chrome-extension-test.zip | |
# The desired behavior if no files are found using the provided path. | |
# Available Options: | |
# warn: Output a warning but do not fail the action | |
# error: Fail the action with an error message | |
# ignore: Do not output any warnings or errors, the action does not fail | |
# Optional. Default is 'warn' | |
if-no-files-found: error | |
# Duration after which artifact will expire in days. 0 means using default retention. | |
# Minimum 1 day. | |
# Maximum 90 days unless changed from the repository settings page. | |
# Optional. Defaults to repository settings. | |
retention-days: 1 | |
- name: Output artifact ID | |
run: echo 'Artifact ID is ${{ steps.artifact-upload-step.outputs.artifact-id }}' | |
# publishing | |
# api usage reference: | |
# * <https://developer.chrome.com/docs/webstore/using_webstore_api/> | |
# * <https://github.com/fregante/chrome-webstore-upload/blob/main/How%20to%20generate%20Google%20API%20keys.md> | |
upload-extension: | |
name: Upload extension | |
runs-on: ubuntu-latest | |
needs: build-chrome-extension | |
env: | |
# you can optionally specify extension ID here, we do this so that | |
# all of our environments (dev, staging, prod) have a consistent ID | |
# we can reference. Otherwise the extension ID is autogenerated. | |
EXTENSION_ID: ${{ secrets.EXTENSION_ID }} | |
steps: | |
- name: Download bundle artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: my-artifact | |
- name: Install webstore cli | |
run: |- | |
npm install -g chrome-webstore-upload-cli | |
- name: Upload step | |
run: | | |
chrome-webstore-upload upload --source chrome-extension-test.zip --auto-publish | |
env: | |
EXTENSION_ID: goecnpeohpdpecpaiobjeclendfhnlmj | |
CLIENT_ID: ${{ secrets.CLIENT_ID }} | |
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }} | |
REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }} |