ci: use GitInfo to generate version #6
This file contains hidden or 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 TS3AudioBot | |
| on: | |
| push: | |
| branches: [ "master", "develop" ] | |
| jobs: | |
| build_tsab: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| tsab_version: ${{ steps.get_version.outputs.tsab_version }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| submodules: 'recursive' | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 9.0.x | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Test | |
| run: dotnet test -c Release --verbosity normal | |
| - name: Build | |
| run: dotnet publish TS3AudioBot -c Release -o publish | |
| - name: Get Version | |
| id: get_version | |
| run: | | |
| TSABVERSION=$(dotnet publish/TS3AudioBot.dll -V | grep -oP 'Version: \K.*') | |
| echo "Get Version: $TSABVERSION" | |
| echo "tsab_version=$TSABVERSION" >> "$GITHUB_OUTPUT" | |
| build_frontend: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 22 | |
| - name: Install yarn | |
| run: npm install -g yarn | |
| - name: Install dependencies | |
| run: | | |
| cd WebInterface | |
| yarn install --frozen-lockfile | |
| - name: Build | |
| run: | | |
| cd WebInterface | |
| yarn run build | |
| - name: Archive | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: webinterface | |
| path: WebInterface/dist | |
| publish: | |
| needs: [ build_tsab, build_frontend ] | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| rid: [ "linux-x64", "linux-arm", "linux-arm64", "win-x64" ] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| submodules: 'recursive' | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 8.0.x | |
| - name: Publish | |
| run: | | |
| dotnet publish TS3AudioBot/TS3AudioBot.csproj \ | |
| -c Release \ | |
| --framework net8.0 \ | |
| --self-contained \ | |
| --runtime ${{ matrix.rid }} \ | |
| -p:PublishSingleFile=true,IncludeNativeLibrariesForSelfExtract=true \ | |
| -o publish | |
| - name: Fetch WebInterface | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: webinterface | |
| path: publish/WebInterface | |
| - name: Archive | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ts3audiobot-${{ matrix.rid }} | |
| path: publish |