AquaDX/.github/workflows/aquamai.yaml
Menci 734dbfb761
[F] Fix AquaMai CI after config refactor (#89)
Message from previous commit:

[RF] AquaMai configuration refactor (#82)

更新了配置文件格式,原有的配置文件将被自动无缝迁移,详情请见新的配置文件中的注释(例外:`SlideJudgeTweak` 不再默认启用)
旧配置文件将被重命名备份,如果更新到此版本遇到 Bug 请联系我们

Updated configuration file schema. The old config file will be migrated automatically and seamlessly. See the comments in the new configuration file for details. (Except for `SlideJudgeTweak` is no longer enabled by default)
Your old configuration file will be renamed as a backup. If you encounter any bug with this version, please contact us.
2024-11-25 02:15:04 +08:00

73 lines
2.0 KiB
YAML

name: AquaMai Build
on:
workflow_dispatch:
push:
paths:
- AquaMai/**
branches:
- v1-dev
pull_request_target:
paths:
- AquaMai/**
branches:
- v1-dev
jobs:
build:
runs-on: windows-latest
steps:
- name: Fix Git line encoding bug
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- uses: actions/checkout@v4
- name: Checkout Assets
uses: clansty/checkout@main
with:
repository: clansty/AquaMai-Build-Assets
ssh-key: ${{ secrets.BUILD_ASSETS_KEY }}
path: build-assets
max-attempts: 50
min-retry-interval: 1
max-retry-interval: 5
- name: Build AquaMai
shell: cmd
run: |
copy /y build-assets\SDEZ\* AquaMai\Libs
cd AquaMai
dotnet build -c Release /p:DefineConstants="CI"
- name: Prepare artifact
shell: cmd
run: |
cd AquaMai\Output
mkdir Upload
move AquaMai.dll Upload
move AquaMai.*.toml Upload
- uses: actions/upload-artifact@v4
with:
name: AquaMai
path: AquaMai\Output\Upload
- name: Send to Telegram
if: github.ref_name == 'v1-dev'
run: |
$Uri = "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMediaGroup"
$Form = @{
chat_id = "-1002231087502"
media = @(
@{ type = "document"; media = "attach://aquamai_main"; caption = "${{ github.event.commits[0].message }}" },
@{ type = "document"; media = "attach://aquamai_zh" }
@{ type = "document"; media = "attach://aquamai_en" }
) | ConvertTo-Json
aquamai_main = Get-Item AquaMai\Output\Upload\AquaMai.dll
aquamai_zh = Get-Item AquaMai\Output\Upload\AquaMai.zh.toml
aquamai_en = Get-Item AquaMai\Output\Upload\AquaMai.en.toml
}
Invoke-RestMethod -Uri $uri -Form $Form -Method Post