Skip to content

chore: release release-v1.0.2 #2

chore: release release-v1.0.2

chore: release release-v1.0.2 #2

Workflow file for this run

name: Build Extension
on:
push:
tags:
- 'build-v*'
- 'release-v*'
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
browser: [chrome, firefox]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'
cache-dependency-path: ext/pnpm-lock.yaml
- name: Install dependencies
working-directory: ./ext
run: pnpm install
- name: Build for ${{ matrix.browser }}
working-directory: ./ext
run: pnpm run build:${{ matrix.browser }}
- name: Zip for ${{ matrix.browser }}
working-directory: ./ext
run: pnpm run zip:${{ matrix.browser }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: cookie-cloud-${{ matrix.browser }}
path: ext/dist/*.zip
retention-days: 30
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download Chrome artifact
uses: actions/download-artifact@v4
with:
name: cookie-cloud-chrome
path: ./artifacts/chrome
- name: Download Firefox artifact
uses: actions/download-artifact@v4
with:
name: cookie-cloud-firefox
path: ./artifacts/firefox
- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: |
./artifacts/chrome/*.zip
./artifacts/firefox/*.zip
generate_release_notes: true
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish:
needs: build
if: startsWith(github.ref, 'refs/tags/release-v')
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'
cache-dependency-path: ext/pnpm-lock.yaml
- name: Install dependencies
working-directory: ./ext
run: pnpm install
- name: Download Chrome artifact
uses: actions/download-artifact@v4
with:
name: cookie-cloud-chrome
path: ext/dist
- name: Resolve chrome zip path
id: zip
working-directory: ./ext
run: |
chrome_zip=$(ls dist/*-chrome.zip | head -n 1)
if [ -z "$chrome_zip" ]; then
echo "No chrome zip found in dist/"
exit 1
fi
echo "chrome_zip=$chrome_zip" >> "$GITHUB_OUTPUT"
echo "Found: $chrome_zip"
- name: Submit to Chrome Web Store and Edge Add-ons
working-directory: ./ext
run: |
npx wxt submit \
--chrome-zip "${{ steps.zip.outputs.chrome_zip }}" \
--edge-zip "${{ steps.zip.outputs.chrome_zip }}"
env:
CHROME_EXTENSION_ID: ${{ secrets.CHROME_EXTENSION_ID }}
CHROME_CLIENT_ID: ${{ secrets.CHROME_CLIENT_ID }}
CHROME_CLIENT_SECRET: ${{ secrets.CHROME_CLIENT_SECRET }}
CHROME_REFRESH_TOKEN: ${{ secrets.CHROME_REFRESH_TOKEN }}
EDGE_PRODUCT_ID: ${{ secrets.EDGE_PRODUCT_ID }}
EDGE_CLIENT_ID: ${{ secrets.EDGE_CLIENT_ID }}
EDGE_API_KEY: ${{ secrets.EDGE_API_KEY }}