chore: lint #21
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
branches: | |
- release | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
id-token: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.12.0 | |
- name: Install deps | |
run: pnpm install | |
- name: Run release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git config user.name "ajiu9" | |
git config user.email "[email protected]" | |
pnpm run release | |
merge-to-main: | |
needs: release | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
id-token: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Ensure main branch exists | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git config user.name "ajiu9" | |
git config user.email "[email protected]" | |
if ! git show-ref --verify --quiet refs/heads/main; then | |
git fetch origin main | |
git checkout -b main origin/main | |
git push --set-upstream origin main | |
else | |
git checkout main | |
git pull origin main | |
fi | |
- name: Merge release to main | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git config user.name "ajiu9" | |
git config user.email "[email protected]" | |
git checkout main | |
git merge release --no-ff -m "Merge release into main" --allow-unrelated-histories || true | |
if [ -n "$(git status --porcelain)" ]; then | |
echo "Conflicts detected. Resolving conflicts..." | |
# 手动解决冲突 | |
git add . | |
git commit -m "Resolve merge conflicts" | |
fi | |
git push origin main |