mirror of
https://github.com/Shik3i/KoalaSync.git
synced 2026-07-26 12:08:15 +00:00
ci: auto-inject version from git tag + unify shared/ mirroring
- CI release workflow now extracts version from tag (v1.4.0 → 1.4.0) and injects it into manifest.base.json, shared/constants.js, and package.json before building — the tag is the single source of truth - Build script now copies README.md alongside constants.js and blacklist.js from /shared → /extension/shared/ (full mirror) - .gitignore updated: extension/shared/ is fully generated by build - AI_INIT.md: simplified release workflow, fixed Chrome-only reference
This commit is contained in:
@@ -52,6 +52,29 @@ jobs:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Extract version from tag
|
||||
id: version
|
||||
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Inject version into source files
|
||||
run: |
|
||||
VERSION=${{ steps.version.outputs.VERSION }}
|
||||
echo "Injecting version $VERSION from tag $GITHUB_REF_NAME..."
|
||||
|
||||
# 1. extension/manifest.base.json
|
||||
jq --arg v "$VERSION" '.version = $v' extension/manifest.base.json > tmp.json && mv tmp.json extension/manifest.base.json
|
||||
echo " ✓ manifest.base.json -> $VERSION"
|
||||
|
||||
# 2. shared/constants.js — APP_VERSION
|
||||
sed -i "s/export const APP_VERSION = '.*'/export const APP_VERSION = '$VERSION'/" shared/constants.js
|
||||
echo " ✓ shared/constants.js -> $VERSION"
|
||||
|
||||
# 3. package.json
|
||||
jq --arg v "$VERSION" '.version = $v' package.json > tmp.json && mv tmp.json package.json
|
||||
echo " ✓ package.json -> $VERSION"
|
||||
|
||||
echo "Version injection complete."
|
||||
|
||||
- name: Build Extensions
|
||||
run: |
|
||||
npm install
|
||||
|
||||
Reference in New Issue
Block a user