🔼 Update actions/checkout action to v6 #977
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 | |
| on: | |
| push: | |
| branches: | |
| - '**' | |
| paths-ignore: | |
| - 'README.md' | |
| - 'LICENSE' | |
| pull_request: | |
| paths-ignore: | |
| - 'README.md' | |
| - 'LICENSE' | |
| jobs: | |
| build: | |
| name: Build | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| fail-fast: false | |
| runs-on: ${{ matrix.os }} | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup dotnet | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: '9' | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Build | |
| run: dotnet build --no-restore | |
| - name: Test | |
| run: dotnet test --no-build --verbosity normal | |
| # Publish | |
| - name: Define MSBuild properties | |
| run: echo "MSBUILD_PROPS=-p:PublishSingleFile=true -p:PublishTrimmed=true -p:DebuggerSupport=false -p:EnableUnsafeBinaryFormatterSerialization=false -p:EnableUnsafeUTF7Encoding=false -p:InvariantGlobalization=true" >> $GITHUB_ENV | |
| - name: Publish framework-dependent | |
| run: | | |
| dotnet publish CubicBot.Telegram.App -c Release --no-restore | |
| dotnet publish CubicBot.Telegram.Tool -c Release --no-restore | |
| - name: Publish self-contained for Linux ARM64 | |
| if: matrix.os == 'ubuntu-latest' | |
| run: | | |
| dotnet publish CubicBot.Telegram.App -c Release $MSBUILD_PROPS -r linux-arm64 --self-contained | |
| dotnet publish CubicBot.Telegram.Tool -c Release $MSBUILD_PROPS -r linux-arm64 --self-contained | |
| - name: Publish self-contained for Linux x64 | |
| if: matrix.os == 'ubuntu-latest' | |
| run: | | |
| dotnet publish CubicBot.Telegram.App -c Release $MSBUILD_PROPS -r linux-x64 --self-contained | |
| dotnet publish CubicBot.Telegram.Tool -c Release $MSBUILD_PROPS -r linux-x64 --self-contained | |
| - name: Publish self-contained for Windows ARM64 | |
| if: matrix.os == 'windows-latest' | |
| run: | | |
| dotnet publish CubicBot.Telegram.App -c Release $MSBUILD_PROPS -r win-arm64 --self-contained | |
| dotnet publish CubicBot.Telegram.Tool -c Release $MSBUILD_PROPS -r win-arm64 --self-contained | |
| - name: Publish self-contained for Windows x64 | |
| if: matrix.os == 'windows-latest' | |
| run: | | |
| dotnet publish CubicBot.Telegram.App -c Release $MSBUILD_PROPS -r win-x64 --self-contained | |
| dotnet publish CubicBot.Telegram.Tool -c Release $MSBUILD_PROPS -r win-x64 --self-contained | |
| - name: Publish self-contained for macOS ARM64 | |
| if: matrix.os == 'macos-latest' | |
| run: | | |
| dotnet publish CubicBot.Telegram.App -c Release $MSBUILD_PROPS -r osx-arm64 --self-contained | |
| dotnet publish CubicBot.Telegram.Tool -c Release $MSBUILD_PROPS -r osx-arm64 --self-contained | |
| - name: Publish self-contained for macOS x64 | |
| if: matrix.os == 'macos-latest' | |
| run: | | |
| dotnet publish CubicBot.Telegram.App -c Release $MSBUILD_PROPS -r osx-x64 --self-contained | |
| dotnet publish CubicBot.Telegram.Tool -c Release $MSBUILD_PROPS -r osx-x64 --self-contained | |
| # Upload CubicBot.Telegram.App | |
| - name: Upload CubicBot.Telegram.App artifacts for Linux ARM64 | |
| if: matrix.os == 'ubuntu-latest' | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: cubic-bot-telegram-app-${{ github.sha }}-linux-arm64 | |
| path: CubicBot.Telegram.App/bin/Release/net9.0/linux-arm64/publish/ | |
| - name: Upload CubicBot.Telegram.App artifacts for Linux x64 | |
| if: matrix.os == 'ubuntu-latest' | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: cubic-bot-telegram-app-${{ github.sha }}-linux-x64 | |
| path: CubicBot.Telegram.App/bin/Release/net9.0/linux-x64/publish/ | |
| - name: Upload CubicBot.Telegram.App artifacts for Linux framework-dependent | |
| if: matrix.os == 'ubuntu-latest' | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: cubic-bot-telegram-app-${{ github.sha }}-linux | |
| path: CubicBot.Telegram.App/bin/Release/net9.0/publish/ | |
| - name: Upload CubicBot.Telegram.App artifacts for Windows ARM64 | |
| if: matrix.os == 'windows-latest' | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: cubic-bot-telegram-app-${{ github.sha }}-windows-arm64 | |
| path: CubicBot.Telegram.App/bin/Release/net9.0/win-arm64/publish/ | |
| - name: Upload CubicBot.Telegram.App artifacts for Windows x64 | |
| if: matrix.os == 'windows-latest' | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: cubic-bot-telegram-app-${{ github.sha }}-windows-x64 | |
| path: CubicBot.Telegram.App/bin/Release/net9.0/win-x64/publish/ | |
| - name: Upload CubicBot.Telegram.App artifacts for Windows framework-dependent | |
| if: matrix.os == 'windows-latest' | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: cubic-bot-telegram-app-${{ github.sha }}-windows | |
| path: CubicBot.Telegram.App/bin/Release/net9.0/publish/ | |
| - name: Upload CubicBot.Telegram.App artifacts for macOS ARM64 | |
| if: matrix.os == 'macos-latest' | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: cubic-bot-telegram-app-${{ github.sha }}-macos-arm64 | |
| path: CubicBot.Telegram.App/bin/Release/net9.0/osx-arm64/publish/ | |
| - name: Upload CubicBot.Telegram.App artifacts for macOS x64 | |
| if: matrix.os == 'macos-latest' | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: cubic-bot-telegram-app-${{ github.sha }}-macos-x64 | |
| path: CubicBot.Telegram.App/bin/Release/net9.0/osx-x64/publish/ | |
| - name: Upload CubicBot.Telegram.App artifacts for macOS framework-dependent | |
| if: matrix.os == 'macos-latest' | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: cubic-bot-telegram-app-${{ github.sha }}-macos | |
| path: CubicBot.Telegram.App/bin/Release/net9.0/publish/ | |
| # Upload CubicBot.Telegram.Tool | |
| - name: Upload CubicBot.Telegram.Tool artifacts for Linux ARM64 | |
| if: matrix.os == 'ubuntu-latest' | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: cubic-bot-telegram-tool-${{ github.sha }}-linux-arm64 | |
| path: CubicBot.Telegram.Tool/bin/Release/net9.0/linux-arm64/publish/ | |
| - name: Upload CubicBot.Telegram.Tool artifacts for Linux x64 | |
| if: matrix.os == 'ubuntu-latest' | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: cubic-bot-telegram-tool-${{ github.sha }}-linux-x64 | |
| path: CubicBot.Telegram.Tool/bin/Release/net9.0/linux-x64/publish/ | |
| - name: Upload CubicBot.Telegram.Tool artifacts for Linux framework-dependent | |
| if: matrix.os == 'ubuntu-latest' | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: cubic-bot-telegram-tool-${{ github.sha }}-linux | |
| path: CubicBot.Telegram.Tool/bin/Release/net9.0/publish/ | |
| - name: Upload CubicBot.Telegram.Tool artifacts for Windows ARM64 | |
| if: matrix.os == 'windows-latest' | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: cubic-bot-telegram-tool-${{ github.sha }}-windows-arm64 | |
| path: CubicBot.Telegram.Tool/bin/Release/net9.0/win-arm64/publish/ | |
| - name: Upload CubicBot.Telegram.Tool artifacts for Windows x64 | |
| if: matrix.os == 'windows-latest' | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: cubic-bot-telegram-tool-${{ github.sha }}-windows-x64 | |
| path: CubicBot.Telegram.Tool/bin/Release/net9.0/win-x64/publish/ | |
| - name: Upload CubicBot.Telegram.Tool artifacts for Windows framework-dependent | |
| if: matrix.os == 'windows-latest' | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: cubic-bot-telegram-tool-${{ github.sha }}-windows | |
| path: CubicBot.Telegram.Tool/bin/Release/net9.0/publish/ | |
| - name: Upload CubicBot.Telegram.Tool artifacts for macOS ARM64 | |
| if: matrix.os == 'macos-latest' | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: cubic-bot-telegram-tool-${{ github.sha }}-macos-arm64 | |
| path: CubicBot.Telegram.Tool/bin/Release/net9.0/osx-arm64/publish/ | |
| - name: Upload CubicBot.Telegram.Tool artifacts for macOS x64 | |
| if: matrix.os == 'macos-latest' | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: cubic-bot-telegram-tool-${{ github.sha }}-macos-x64 | |
| path: CubicBot.Telegram.Tool/bin/Release/net9.0/osx-x64/publish/ | |
| - name: Upload CubicBot.Telegram.Tool artifacts for macOS framework-dependent | |
| if: matrix.os == 'macos-latest' | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: cubic-bot-telegram-tool-${{ github.sha }}-macos | |
| path: CubicBot.Telegram.Tool/bin/Release/net9.0/publish/ |