feat: Enable automatic release creation in CI workflow with versioning and artifact publishing

This commit is contained in:
HueByte
2026-02-19 09:56:58 +01:00
parent 16e0b0743d
commit b0e1ec48af
+92 -94
View File
@@ -70,97 +70,95 @@ jobs:
- name: Test - name: Test
run: dotnet test src/EchoHub.slnx --no-build --configuration Release --verbosity normal run: dotnet test src/EchoHub.slnx --no-build --configuration Release --verbosity normal
# NOTE: Release job disabled until workflows are verified. release:
# Uncomment to enable automatic releases with tags. name: Create Release
# release: needs: [lint-markdown, detect-changes, test]
# name: Create Release if: needs.detect-changes.outputs.src_changed == 'true'
# needs: [lint-markdown, detect-changes, test] runs-on: ubuntu-latest
# if: needs.detect-changes.outputs.src_changed == 'true' steps:
# runs-on: ubuntu-latest - uses: actions/checkout@v4
# steps:
# - uses: actions/checkout@v4 - name: Setup .NET 10
# uses: actions/setup-dotnet@v4
# - name: Setup .NET 10 with:
# uses: actions/setup-dotnet@v4 dotnet-version: '10.0.x'
# with:
# dotnet-version: '10.0.x' - name: Read version
# id: version
# - name: Read version run: |
# id: version VERSION=$(grep -oP '(?<=<Version>)[^<]+' src/Directory.Build.props)
# run: | echo "version=$VERSION" >> "$GITHUB_OUTPUT"
# VERSION=$(grep -oP '(?<=<Version>)[^<]+' src/Directory.Build.props) echo "tag=v$VERSION" >> "$GITHUB_OUTPUT"
# echo "version=$VERSION" >> "$GITHUB_OUTPUT"
# echo "tag=v$VERSION" >> "$GITHUB_OUTPUT" - name: Check if release exists
# id: check_release
# - name: Check if release exists run: |
# id: check_release if gh release view "${{ steps.version.outputs.tag }}" &>/dev/null; then
# run: | echo "exists=true" >> "$GITHUB_OUTPUT"
# if gh release view "${{ steps.version.outputs.tag }}" &>/dev/null; then else
# echo "exists=true" >> "$GITHUB_OUTPUT" echo "exists=false" >> "$GITHUB_OUTPUT"
# else fi
# echo "exists=false" >> "$GITHUB_OUTPUT" env:
# fi GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# env:
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Publish Server win-x64
# if: steps.check_release.outputs.exists == 'false'
# - name: Publish Server win-x64 run: dotnet publish src/EchoHub.Server/EchoHub.Server.csproj -c Release -r win-x64 --self-contained true -o publish/server-win-x64
# if: steps.check_release.outputs.exists == 'false'
# run: dotnet publish src/EchoHub.Server/EchoHub.Server.csproj -c Release -r win-x64 --self-contained true -o publish/server-win-x64 - name: Publish Server linux-x64
# if: steps.check_release.outputs.exists == 'false'
# - name: Publish Server linux-x64 run: dotnet publish src/EchoHub.Server/EchoHub.Server.csproj -c Release -r linux-x64 --self-contained true -o publish/server-linux-x64
# if: steps.check_release.outputs.exists == 'false'
# run: dotnet publish src/EchoHub.Server/EchoHub.Server.csproj -c Release -r linux-x64 --self-contained true -o publish/server-linux-x64 - name: Publish Server osx-x64
# if: steps.check_release.outputs.exists == 'false'
# - name: Publish Server osx-x64 run: dotnet publish src/EchoHub.Server/EchoHub.Server.csproj -c Release -r osx-x64 --self-contained true -o publish/server-osx-x64
# if: steps.check_release.outputs.exists == 'false'
# run: dotnet publish src/EchoHub.Server/EchoHub.Server.csproj -c Release -r osx-x64 --self-contained true -o publish/server-osx-x64 - name: Publish Server osx-arm64
# if: steps.check_release.outputs.exists == 'false'
# - name: Publish Server osx-arm64 run: dotnet publish src/EchoHub.Server/EchoHub.Server.csproj -c Release -r osx-arm64 --self-contained true -o publish/server-osx-arm64
# if: steps.check_release.outputs.exists == 'false'
# run: dotnet publish src/EchoHub.Server/EchoHub.Server.csproj -c Release -r osx-arm64 --self-contained true -o publish/server-osx-arm64 - name: Publish Client win-x64
# if: steps.check_release.outputs.exists == 'false'
# - name: Publish Client win-x64 run: dotnet publish src/EchoHub.Client/EchoHub.Client.csproj -c Release -r win-x64 --self-contained true -o publish/client-win-x64
# if: steps.check_release.outputs.exists == 'false'
# run: dotnet publish src/EchoHub.Client/EchoHub.Client.csproj -c Release -r win-x64 --self-contained true -o publish/client-win-x64 - name: Publish Client linux-x64
# if: steps.check_release.outputs.exists == 'false'
# - name: Publish Client linux-x64 run: dotnet publish src/EchoHub.Client/EchoHub.Client.csproj -c Release -r linux-x64 --self-contained true -o publish/client-linux-x64
# if: steps.check_release.outputs.exists == 'false'
# run: dotnet publish src/EchoHub.Client/EchoHub.Client.csproj -c Release -r linux-x64 --self-contained true -o publish/client-linux-x64 - name: Publish Client osx-x64
# if: steps.check_release.outputs.exists == 'false'
# - name: Publish Client osx-x64 run: dotnet publish src/EchoHub.Client/EchoHub.Client.csproj -c Release -r osx-x64 --self-contained true -o publish/client-osx-x64
# if: steps.check_release.outputs.exists == 'false'
# run: dotnet publish src/EchoHub.Client/EchoHub.Client.csproj -c Release -r osx-x64 --self-contained true -o publish/client-osx-x64 - name: Publish Client osx-arm64
# if: steps.check_release.outputs.exists == 'false'
# - name: Publish Client osx-arm64 run: dotnet publish src/EchoHub.Client/EchoHub.Client.csproj -c Release -r osx-arm64 --self-contained true -o publish/client-osx-arm64
# if: steps.check_release.outputs.exists == 'false'
# run: dotnet publish src/EchoHub.Client/EchoHub.Client.csproj -c Release -r osx-arm64 --self-contained true -o publish/client-osx-arm64 - name: Zip artifacts
# if: steps.check_release.outputs.exists == 'false'
# - name: Zip artifacts run: |
# if: steps.check_release.outputs.exists == 'false' cd publish
# run: | zip -r ../EchoHub-Server-win-x64.zip server-win-x64/
# cd publish zip -r ../EchoHub-Server-linux-x64.zip server-linux-x64/
# zip -r ../EchoHub-Server-win-x64.zip server-win-x64/ zip -r ../EchoHub-Server-osx-x64.zip server-osx-x64/
# zip -r ../EchoHub-Server-linux-x64.zip server-linux-x64/ zip -r ../EchoHub-Server-osx-arm64.zip server-osx-arm64/
# zip -r ../EchoHub-Server-osx-x64.zip server-osx-x64/ zip -r ../EchoHub-Client-win-x64.zip client-win-x64/
# zip -r ../EchoHub-Server-osx-arm64.zip server-osx-arm64/ zip -r ../EchoHub-Client-linux-x64.zip client-linux-x64/
# zip -r ../EchoHub-Client-win-x64.zip client-win-x64/ zip -r ../EchoHub-Client-osx-x64.zip client-osx-x64/
# zip -r ../EchoHub-Client-linux-x64.zip client-linux-x64/ zip -r ../EchoHub-Client-osx-arm64.zip client-osx-arm64/
# zip -r ../EchoHub-Client-osx-x64.zip client-osx-x64/
# zip -r ../EchoHub-Client-osx-arm64.zip client-osx-arm64/ - name: Create GitHub Release
# if: steps.check_release.outputs.exists == 'false'
# - name: Create GitHub Release run: |
# if: steps.check_release.outputs.exists == 'false' gh release create "${{ steps.version.outputs.tag }}" \
# run: | --title "EchoHub ${{ steps.version.outputs.tag }}" \
# gh release create "${{ steps.version.outputs.tag }}" \ --generate-notes \
# --title "EchoHub ${{ steps.version.outputs.tag }}" \ EchoHub-Server-win-x64.zip \
# --generate-notes \ EchoHub-Server-linux-x64.zip \
# EchoHub-Server-win-x64.zip \ EchoHub-Server-osx-x64.zip \
# EchoHub-Server-linux-x64.zip \ EchoHub-Server-osx-arm64.zip \
# EchoHub-Server-osx-x64.zip \ EchoHub-Client-win-x64.zip \
# EchoHub-Server-osx-arm64.zip \ EchoHub-Client-linux-x64.zip \
# EchoHub-Client-win-x64.zip \ EchoHub-Client-osx-x64.zip \
# EchoHub-Client-linux-x64.zip \ EchoHub-Client-osx-arm64.zip
# EchoHub-Client-osx-x64.zip \ env:
# EchoHub-Client-osx-arm64.zip GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# env:
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}