68 lines
1.8 KiB
YAML
68 lines
1.8 KiB
YAML
name: Build and Release Extension
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
|
|
- name: Install pnpm
|
|
uses: pnpm/action-setup@v2
|
|
with:
|
|
version: 10
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install
|
|
|
|
- name: Extract version from tag
|
|
id: version
|
|
run: |
|
|
# Remove 'v' prefix from tag (v1.0.0 -> 1.0.0)
|
|
VERSION=${GITHUB_REF_NAME#v}
|
|
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
|
|
echo "Extracted version: $VERSION"
|
|
|
|
- name: Update manifest version
|
|
run: |
|
|
VERSION=${{ steps.version.outputs.VERSION }}
|
|
sed -i "s/\"version\": \"[^\"]*\"/\"version\": \"$VERSION\"/" src/manifest.chrome.json
|
|
sed -i "s/\"version\": \"[^\"]*\"/\"version\": \"$VERSION\"/" src/manifest.firefox.json
|
|
echo "Updated manifest.chrome.json:"
|
|
cat src/manifest.chrome.json
|
|
echo "Updated manifest.firefox.json:"
|
|
cat src/manifest.firefox.json
|
|
|
|
- name: Build Chrome extension
|
|
run: pnpm build:chrome
|
|
|
|
- name: Build Firefox extension
|
|
run: pnpm build:firefox
|
|
|
|
- name: Create Release Draft
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
draft: true
|
|
name: Reels Master v${{ steps.version.outputs.VERSION }}
|
|
tag_name: ${{ github.ref_name }}
|
|
files: |
|
|
reels-master-chrome.zip
|
|
reels-master-firefox.zip
|
|
generate_release_notes: true
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|