[+] Generate example config via attributes #108
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
name: Build AquaMai | |
on: | |
workflow_dispatch: | |
push: | |
paths: | |
- AquaMai/** | |
branches: | |
- v1-dev | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- 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 | |
- name: Make example config | |
shell: cmd | |
run: | | |
cd AquaMai\Output | |
dotnet tool install -g dotnet-script | |
dotnet script genConfig.csx | |
- 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\AquaMai.dll | |
- name: Send to Telegram | |
if: github.event_name != 'pull_request' | |
run: | | |
$Uri = "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMediaGroup" | |
$Form = @{ | |
chat_id = "-1001476514052" | |
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 |