Skip to content
Merged

Dev #58

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,24 +53,34 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout dev
uses: actions/checkout@v4
with:
ref: dev
fetch-depth: 0

- name: Sync package.json version from main
- name: Sync package.json version from main via PR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
MAIN_VERSION=$(git show origin/main:package.json | node -p "JSON.parse(require('fs').readFileSync(0,'utf8')).version")
DEV_VERSION=$(node -p "require('./package.json').version")
if [ "$MAIN_VERSION" != "$DEV_VERSION" ]; then
npm version "$MAIN_VERSION" --no-git-tag-version --allow-same-version
BRANCH="chore/sync-version-${MAIN_VERSION}"
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git checkout -b "$BRANCH"
npm version "$MAIN_VERSION" --no-git-tag-version --allow-same-version
git add package.json package-lock.json
git commit -m "chore: sync package.json version to $MAIN_VERSION from main"
git push
git push origin "$BRANCH"
gh pr create \
--base dev \
--head "$BRANCH" \
--title "chore: sync package.json version to $MAIN_VERSION from main" \
--body "Automated version sync from main after release."
fi

dev-release:
Expand Down
Loading