Skip to content

chore: github workflow #14

chore: github workflow

chore: github workflow #14

Workflow file for this run

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
git push origin main