-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3332fdc
commit 35af54b
Showing
1 changed file
with
53 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: CronJob | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: "0 */1 * * *" | ||
|
||
jobs: | ||
get_wechat_version: | ||
name: Get Wechat Version | ||
runs-on: windows-latest | ||
steps: | ||
- name: Execute PowerShell commands | ||
id: powershell | ||
shell: pwsh | ||
run: | | ||
$SetupFilePath="$env:TEMP\WeChatSetup.exe" | ||
$InstalledFilePath="${env:ProgramFiles(x86)}\Tencent\WeChat" | ||
Invoke-WebRequest -Uri "https://dldir1.qq.com/weixin/Windows/WeChatSetup.exe" -OutFile $SetupFilePath | ||
Invoke-Expression "$SetupFilePath /S" | ||
$DirectoryName=Get-ChildItem -Path $InstalledFilePath -Filter "[*]" -Directory -Name | ||
$Version=$DirectoryName.Trim("[]") | ||
echo "::set-output name=version::$Version" | ||
run_update_script: | ||
name: Run Update Script | ||
needs: get_wechat_version | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Run gen.sh with version | ||
uses: vufa/arch-makepkg-action@master | ||
with: | ||
scripts: ./gen.sh -u ${{ needs.get_wechat_version.outputs.version }} | ||
|
||
- name: Check git status | ||
id: status | ||
run: | | ||
if [ -n "$(git status --porcelain)" ]; then | ||
echo "::set-output name=changed::true" | ||
fi | ||
- name: Create pull request if changed | ||
if: steps.status.outputs.changed == 'true' | ||
uses: peter-evans/create-pull-request@v5 | ||
with: | ||
title: Update WeChat version to ${{ needs.build_and_push.outputs.version }} | ||
commit-message: Update WeChat version to ${{ needs.build_and_push.outputs.version }} | ||
base: action | ||
delete-branch: true | ||
branch-suffix: timestamp |