-
Notifications
You must be signed in to change notification settings - Fork 13
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
Showing
1 changed file
with
67 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,67 @@ | ||
name: AquaMai Build | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
pull_request_target: | ||
branches: | ||
- main | ||
|
||
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: MewoLab/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\* Libs | ||
dotnet build -c Release /p:DefineConstants="CI" | ||
- name: Prepare artifact | ||
shell: cmd | ||
run: | | ||
cd Output | ||
mkdir Upload | ||
move AquaMai.dll Upload | ||
move AquaMai.*.toml Upload | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: AquaMai | ||
path: Output\Upload | ||
|
||
- name: Send to Telegram | ||
if: github.event_name != 'pull_request_target' | ||
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 Output\Upload\AquaMai.dll | ||
aquamai_zh = Get-Item Output\Upload\AquaMai.zh.toml | ||
aquamai_en = Get-Item Output\Upload\AquaMai.en.toml | ||
} | ||
Invoke-RestMethod -Uri $uri -Form $Form -Method Post |