Create main.yml #1
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: Chrome Extension CI | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build-and-publish: | |
name: Upload extension | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/setup-node@v2-beta | |
with: | |
node-version: "16.10" | |
- name: Install webstore cli | |
run: |- | |
npm install -g chrome-webstore-upload-cli | |
- name: Extract manifest version | |
run: | | |
MANIFEST_VERSION=$(jq -r '.version' manifest.json) | |
echo "MANIFEST_VERSION=$MANIFEST_VERSION" >> $GITHUB_ENV | |
- name: Upload step | |
run: |- | |
chrome-webstore-upload upload \ | |
--source dist/package/chrome/boycott-z-${{ env.MANIFEST_VERSION }}.zip \ | |
--extension-id ${{ secrets.EXTENSION_ID }} \ | |
--client-id ${{ secrets.CI_GOOGLE_CLIENT_ID }} \ | |
--client-secret ${{ secrets.CI_GOOGLE_CLIENT_SECRET }} \ | |
--refresh-token ${{ secrets.CI_GOOGLE_REFRESH_TOKEN }} |