Skip to content

CI/CD for Chrome Extension #29

CI/CD for Chrome Extension

CI/CD for Chrome Extension #29

Workflow file for this run

name: CI/CD for Chrome Extension
on:
push:
tags:
- '*'
workflow_dispatch:
jobs:
build:
runs-on: self-hosted
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Cleanup
run: |
rm output -rf
- name: Zip the extension
run: |
mkdir output
VERSION=$(jq -r '.version' ./app/manifest.json)
zip -r ./output/ShaderToy-Chrome-Plugin-$VERSION.zip ./app
echo $VERSION >> ./output/version.txt
- name: Upload output as artifact
uses: actions/upload-artifact@v4
with:
name: output
path: output/
publish:
runs-on: self-hosted
needs: build
steps:
- name: Download output artifact for publishing
uses: actions/download-artifact@v4
with:
name: output
- name: Upload to Chrome Web Store
uses: mnao305/[email protected]
with:
file-path: ./output/ShaderToy-Chrome-Plugin-$(cat ./output/version.txt).zip
extension-id: $APP_ID
client-id: $CLIENT_ID
client-secret: $CLIENT_SECRET
refresh-token: $REFRESH_TOKEN
publish: true
release:
runs-on: self-hosted
needs: build
steps:
- name: Download output artifact for release
uses: actions/download-artifact@v4
with:
name: output
- name: Publish Release on GitHub
run: |
VERSION=$(cat ./output/version.txt)
gh release create $VERSION ./output/ShaderToy-Chrome-Plugin-$VERSION.zip --title "$VERSION" --notes "Release of version $VERSION"