steps:
- name: Install dependencies
run: npm install
timeout: 120
- name: Build release branch
run: |
git config user.email "ci@pear-git"
git config user.name "pear-git-ci"
# Create orphan release branch (no history, small)
git checkout --orphan release-tmp
# Remove .gitignore so node_modules can be committed
rm -f .gitignore
echo "" > .gitignore
# Stage everything
git add -f .
git commit -m "release: $(git log -1 --format='%h %s' master 2>/dev/null || echo 'latest')"
# Force-push as release branch
git push origin release-tmp:release --force
# Switch back
git checkout -f master
git branch -D release-tmp 2>/dev/null || true
timeout: 300