feat: prepare repo for release with sanitized docs, license, pre-commit hook, and CI/CD workflows
This commit is contained in:
@@ -0,0 +1,71 @@
|
||||
name: Build & Package Extension Release
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build-release:
|
||||
name: Build ZIP & Attach to GitHub Release
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Read Extension Version
|
||||
id: version
|
||||
run: |
|
||||
VERSION=$(node -p "require('./manifest.json').version")
|
||||
echo "EXT_VERSION=$VERSION" >> $GITHUB_ENV
|
||||
echo "Building extension release for version: $VERSION"
|
||||
|
||||
- name: Build Production Extension ZIP
|
||||
run: |
|
||||
ZIP_NAME="brightwheel-exporter-v${{ env.EXT_VERSION }}.zip"
|
||||
echo "📦 Packaging $ZIP_NAME..."
|
||||
zip -r "$ZIP_NAME" . \
|
||||
-x "*.git*" \
|
||||
-x ".githooks/*" \
|
||||
-x ".github/*" \
|
||||
-x "emmy/*" \
|
||||
-x "exports/*" \
|
||||
-x "data/*" \
|
||||
-x "test_data/*" \
|
||||
-x "*.md" \
|
||||
-x "LICENSE" \
|
||||
-x "*.zip"
|
||||
|
||||
echo "ZIP_FILE=$ZIP_NAME" >> $GITHUB_ENV
|
||||
echo "✅ Package contents verified:"
|
||||
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