Skip to content

Commit

Permalink
[+] Generate example config via attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
clansty committed Oct 27, 2024
1 parent 5eb0424 commit 6bb2685
Show file tree
Hide file tree
Showing 9 changed files with 541 additions and 510 deletions.
27 changes: 24 additions & 3 deletions .github/workflows/aquamai.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,21 @@ jobs:
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
Expand All @@ -39,10 +54,16 @@ jobs:
- name: Send to Telegram
if: github.event_name != 'pull_request'
run: |
$Uri = "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendDocument"
$Uri = "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMediaGroup"
$Form = @{
chat_id = "-1002231087502"
caption = "${{ github.event.commits[0].message }}"
document = Get-Item AquaMai\Output\AquaMai.dll
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
8 changes: 6 additions & 2 deletions AquaMai/AquaMai.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,6 @@
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="AquaMai.zh.toml" WithCulture="false" />
<EmbeddedResource Include="AquaMai.toml" />
<EmbeddedResource Include="Resources\Locale.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Locale.Designer.cs</LastGenOutput>
Expand All @@ -313,4 +311,10 @@
<PackageReference Include="Samboy063.Tomlet" Version="5.4.0" />
</ItemGroup>

<ItemGroup>
<None Update="genConfig.csx">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
227 changes: 0 additions & 227 deletions AquaMai/AquaMai.toml

This file was deleted.

Loading

0 comments on commit 6bb2685

Please sign in to comment.