fix(ci): add contents:write permission and tag trigger to release workflow
This commit is contained in:
@@ -3,8 +3,14 @@ name: Build & Package Extension Release
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
build-release:
|
||||
name: Build ZIP & Attach to GitHub Release
|
||||
@@ -14,6 +20,11 @@ jobs:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
|
||||
- name: Read Extension Version
|
||||
id: version
|
||||
run: |
|
||||
@@ -43,30 +54,8 @@ jobs:
|
||||
unzip -l "$ZIP_NAME"
|
||||
|
||||
- name: Upload ZIP to GitHub Release Assets
|
||||
if: github.event_name == 'release'
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
files: ${{ env.ZIP_FILE }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
# ------------------------------------------------------------------------
|
||||
# TODO: Auto-Publish to Chrome Web Store
|
||||
# ------------------------------------------------------------------------
|
||||
# Once you create the initial extension item in the Chrome Web Store Developer
|
||||
# Dashboard and generate Google Cloud OAuth credentials, uncomment this step
|
||||
# and configure the following 4 secrets in GitHub (Settings > Secrets > Actions):
|
||||
# - CHROME_EXTENSION_ID
|
||||
# - CHROME_CLIENT_ID
|
||||
# - CHROME_CLIENT_SECRET
|
||||
# - CHROME_REFRESH_TOKEN
|
||||
# ------------------------------------------------------------------------
|
||||
# - name: Upload & Publish to Chrome Web Store
|
||||
# uses: fregante/chrome-web-store-upload-action@v2
|
||||
# with:
|
||||
# file-name: ${{ env.ZIP_FILE }}
|
||||
# extension-id: ${{ secrets.CHROME_EXTENSION_ID }}
|
||||
# client-id: ${{ secrets.CHROME_CLIENT_ID }}
|
||||
# client-secret: ${{ secrets.CHROME_CLIENT_SECRET }}
|
||||
# refresh-token: ${{ secrets.CHROME_REFRESH_TOKEN }}
|
||||
# publish: true
|
||||
|
||||
Reference in New Issue
Block a user