Skip to content

Commit

Permalink
fix autoupdate
Browse files Browse the repository at this point in the history
  • Loading branch information
waruqi committed Jan 11, 2024
1 parent 9bfe7fe commit 093a5a9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 0 additions & 1 deletion .github/workflows/autoupdate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ jobs:
- uses: xmake-io/github-action-setup-xmake@v1
with:
xmake-version: latest
actions-cache-folder: '.xmake-cache'

- name: Installation
run: |
Expand Down
4 changes: 3 additions & 1 deletion scripts/autoupdate.lua
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ function _update_version(instance, version, shasum)
local branch_current = os.iorun("git branch --show-current"):trim()
local repourl = "[email protected]:xmake-io/xmake-repo.git"
os.vexec("git reset --hard HEAD")
os.vexec("git clean -fdx")
os.execv("git", {"branch", "-D", branch}, {try = true})
os.vexec("git checkout dev")
os.vexec("git pull %s dev", repourl)
Expand All @@ -82,7 +83,8 @@ function _update_version(instance, version, shasum)
os.vexec("git add .")
os.vexec("git commit -a -m \"Update %s to %s\"", instance:name(), version)
os.vexec("git push %s %s:%s", repourl, branch, branch)
os.vexec("gh pr create --title \"Auto-update %s to %s\" --body \"%s\" -R xmake-io/xmake-repo -B dev -H %s", instance:name(), version, body, branch)
os.vexec("gh pr create --label \"auto-update\" --title \"Auto-update %s to %s\" --body \"%s\" -R xmake-io/xmake-repo -B dev -H %s",
instance:name(), version, body, branch)
end
os.vexec("git reset --hard HEAD")
os.vexec("git checkout %s", branch_current)
Expand Down

0 comments on commit 093a5a9

Please sign in to comment.