Commit a68f4174 authored by 赵小蒙's avatar 赵小蒙

update workflow

parent 2d0d5a82
...@@ -17,9 +17,6 @@ jobs: ...@@ -17,9 +17,6 @@ jobs:
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v4
with:
ref: master # 确保签出 master 分支
fetch-depth: 0 # 确保获取完整的 git 历史记录
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v5 uses: actions/setup-python@v5
...@@ -52,37 +49,38 @@ jobs: ...@@ -52,37 +49,38 @@ jobs:
env: env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
run: | run: |
git remote set-url origin https://myhloli:${{ secrets.RELEASE_TOKEN }}@github.com/magicpdf/Magic-PDF.git git push origin master
git checkout -b update-version-branch || git checkout update-version-branch # git remote set-url origin https://myhloli:${{ secrets.RELEASE_TOKEN }}@github.com/magicpdf/Magic-PDF.git
git push --set-upstream origin update-version-branch # git checkout -b update-version-branch || git checkout update-version-branch
id: push_changes # git push --set-upstream origin update-version-branch
# id: push_changes
- name: Create Pull Request
if: steps.push_changes.outcome == 'success' # - name: Create Pull Request
id: create_pull_request # if: steps.push_changes.outcome == 'success'
uses: peter-evans/create-pull-request@v5 # id: create_pull_request
with: # uses: peter-evans/create-pull-request@v5
token: ${{ secrets.RELEASE_TOKEN }} # with:
commit-message: Update version.py with new version # token: ${{ secrets.RELEASE_TOKEN }}
branch: update-version-branch # commit-message: Update version.py with new version
title: 'Update version.py' # branch: update-version-branch
body: 'This PR updates the version.py file with the latest version.' # title: 'Update version.py'
base: master # body: 'This PR updates the version.py file with the latest version.'
labels: 'automated PR' # base: master
# labels: 'automated PR'
- name: Merge Pull Request #
if: steps.create_pull_request.outputs.pull-request-number # - name: Merge Pull Request
uses: actions/github-script@v6 # if: steps.create_pull_request.outputs.pull-request-number
with: # uses: actions/github-script@v6
github-token: ${{ secrets.RELEASE_TOKEN }} # with:
script: | # github-token: ${{ secrets.RELEASE_TOKEN }}
const pullRequestNumber = parseInt('${{ steps.create_pull_request.outputs.pull-request-number }}'); # script: |
await github.pulls.merge({ # const pullRequestNumber = parseInt('${{ steps.create_pull_request.outputs.pull-request-number }}');
owner: context.repo.owner, # await github.pulls.merge({
repo: context.repo.repo, # owner: context.repo.owner,
pull_number: pullRequestNumber, # repo: context.repo.repo,
merge_method: 'merge' # pull_number: pullRequestNumber,
}); # merge_method: 'merge'
# });
build: build:
needs: [ update-version ] needs: [ update-version ]
......
__version__ = "0.0.8" __version__ = "0.0.9"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment