解决冲突 #140
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: Build | |
on: | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
jobs: | |
build: | |
if: ${{ github.actor != 'github-actions[bot]' }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v2.2.4 | |
with: | |
version: latest | |
run_install: true | |
- name: Install dependencies | |
run: pnpm install | |
- name: Update-versions | |
run: pnpm run update-versions | |
- name: Git config | |
run: | | |
git config --local user.email github-actions[bot]@users.noreply.github.com | |
git config --local user.name github-actions[bot] | |
git config --global core.autocrlf true | |
git config --global core.safecrlf false | |
- name: Check changes | |
id: check | |
run: | | |
changed=$(git diff --name-only remotes/origin/master..remotes/origin/releases -- src) | |
if [ -n "$changed" ]; then | |
echo "::set-output name=has_changes::true" | |
else | |
echo "::set-output name=has_changes::false" | |
fi | |
- name: Commit versions-update | |
if: steps.check.outputs.has_changes == 'true' | |
run: | | |
git add src | |
git commit -m "Update versions" | |
- name: Push to ref | |
if: steps.check.outputs.has_changes == 'true' | |
run: | | |
git push origin HEAD:${{ github.ref_name }} | |
- name: Checkout releases | |
run: | | |
git stash | |
git fetch | |
git checkout -b remotes/origin/releases | |
git pull origin HEAD:releases | |
git rebase origin/releases | |
git stash pop | |
- name: Build | |
run: pnpm run build | |
- name: Commit releases | |
run: | | |
git add -f out | |
git add . | |
git commit -m "CI build" | |
- name: Push to releases | |
run: | | |
git push origin HEAD:releases |