Merge branch 'main' into web/AddConfigWebsite #1439
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 debug | |
on: | |
push: | |
paths: | |
- "**.cs" | |
- "**.csproj" | |
- "**.json" | |
- "**.props" | |
- "**.sln" | |
- "CHANGELOG.md" | |
- "**/dotnet.yml" | |
workflow_dispatch: | |
jobs: | |
extract_meta: | |
name: Extract metadata for use | |
runs-on: ubuntu-latest | |
outputs: | |
loc_cs: ${{ steps.loc_cs.outputs.total_lines }} | |
datetime: ${{ steps.dateTime.outputs.time }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Get Date and Time | |
id: dateTime | |
uses: Kaven-Universe/github-action-current-date-time@v1 | |
with: | |
format: "YYYY-MM-DDTHH:mm:ss" | |
- name: Calculate Lines of Source Code | |
if: ${{ github.actor != 'dependabot[bot]' }} | |
id: loc_cs | |
uses: PavanMudigonda/lines-of-code-reporter@v1.6 | |
with: | |
include_lang: "C#,MSBuild script" | |
build-amd: | |
name: Build DEBUG for ${{ matrix.os }} - ${{ matrix.arch }} | |
needs: extract_meta | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- os: linux | |
arch: x64 | |
- os: linux | |
arch: arm64 | |
- os: win | |
arch: x64 | |
- os: win | |
arch: arm64 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup .NET 8.0.x | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '8.0.x' | |
- name: Install GitHub CLI | |
run: sudo apt update && sudo apt install -y gh | |
- name: Publish Bot Debug | |
run: | | |
dotnet publish /home/runner/work/AzzyBot/AzzyBot/src/AzzyBot.Bot/AzzyBot.Bot.csproj -c Debug -r ${{ matrix.os }}-${{ matrix.arch }} | |
- name: Publish Web Debug | |
run: | | |
dotnet publish /home/runner/work/AzzyBot/AzzyBot/src/AzzyBot.Web/AzzyBot.Web.csproj -c Debug -r ${{ matrix.os }}-${{ matrix.arch }} | |
#- name: Download and extract Lavalink | |
# run: | | |
# mkdir -p ./artifacts/publish/AzzyBot/debug_${{ matrix.os }}-${{ matrix.arch }}/Modules/MusicStreaming/Files/plugins | |
# gh release download 4.0.4 --dir './artifacts/publish/AzzyBot/debug_${{ matrix.os }}-${{ matrix.arch }}/Modules/MusicStreaming/Files' --pattern 'Lavalink.jar' --repo lavalink-devs/Lavalink | |
# wget -qO ./artifacts/publish/AzzyBot/debug_${{ matrix.os }}-${{ matrix.arch }}/Modules/MusicStreaming/Files/plugins/java-lyrics-plugin-1.6.4.jar https://maven.lavalink.dev/releases/me/duncte123/java-lyrics-plugin/1.6.4/java-lyrics-plugin-1.6.4.jar | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Add some basic information | |
run: | | |
sed -i 's\Commit not found\${{ github.sha }}\g' ./artifacts/publish/AzzyBot.Bot/debug_${{ matrix.os }}-${{ matrix.arch }}/Modules/Core/Files/AppStats.json | |
sed -i 's\Compilation date not found\${{ needs.extract_meta.outputs.datetime }}\g' ./artifacts/publish/AzzyBot.Bot/debug_${{ matrix.os }}-${{ matrix.arch }}/Modules/Core/Files/AppStats.json | |
sed -i 's\Lines of source code not found\${{ needs.extract_meta.outputs.loc_cs }}\g' ./artifacts/publish/AzzyBot.Bot/debug_${{ matrix.os }}-${{ matrix.arch }}/Modules/Core/Files/AppStats.json | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Archive Bot Build Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: debug-bot-${{ matrix.os }}-${{ matrix.arch }} | |
path: ./artifacts/publish/AzzyBot.Bot/debug_${{ matrix.os }}-${{ matrix.arch }} | |
- name: Archive Web Build Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: debug-web-${{ matrix.os }}-${{ matrix.arch }} | |
path: ./artifacts/publish/AzzyBot.Web/debug_${{ matrix.os }}-${{ matrix.arch }} |