CI #84
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: CI | |
| on: | |
| workflow_dispatch: | |
| inputs: {} | |
| push: | |
| branches: [ main ] | |
| paths-ignore: | |
| - '.github/**' | |
| - 'docs/**' | |
| - 'assets/**' | |
| - '.vscode/**' | |
| - '*.yml' | |
| - '*.json' | |
| - '*.md' | |
| - '.gitignore' | |
| - '.gitattributes' | |
| env: | |
| BASE_VERSION: "2.0" | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| name: "Checkout code" | |
| - name: Get version info | |
| id: version_info | |
| run: | | |
| echo "build_version=${{ env.BASE_VERSION }}.$((${{ github.run_number }} - 79))" >> $GITHUB_OUTPUT | |
| echo "prev_build_version=${{ env.BASE_VERSION }}.$(($((${{ github.run_number }} - 79)) - 1))" >> $GITHUB_OUTPUT | |
| echo "git_short_hash=$(git rev-parse --short "${{ github.sha }}")" >> $GITHUB_OUTPUT | |
| shell: bash | |
| - uses: actions/setup-dotnet@v5 | |
| name: "Install .NET SDK" | |
| with: | |
| global-json-file: global.json | |
| - name: Compile | |
| run: bash build.sh ${{ steps.version_info.outputs.build_version }} false | |
| - name: Compile & publish client library | |
| run: | | |
| cd src/Client | |
| dotnet build -c Release -o ../../nuget_build/client -p:Version="${{ steps.version_info.outputs.build_version }}" -p:PackageReleaseNotes="https://github.com/Ryubing/UpdateServer/compare/${{ steps.version_info.outputs.prev_build_version }}...${{ steps.version_info.outputs.build_version }}" | |
| cd ../../ | |
| cd src/Common | |
| dotnet build -c Release -o ../../nuget_build/common -p:Version="${{ steps.version_info.outputs.build_version }}" -p:PackageReleaseNotes="https://github.com/Ryubing/UpdateServer/compare/${{ steps.version_info.outputs.prev_build_version }}...${{ steps.version_info.outputs.build_version }}" | |
| cd ../../ | |
| dotnet nuget push "nuget_build/client/Ryujinx.UpdateClient.${{ steps.version_info.outputs.build_version }}.nupkg" --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_TOKEN }} | |
| dotnet nuget push "nuget_build/common/Ryujinx.Systems.Update.Common.${{ steps.version_info.outputs.build_version }}.nupkg" --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_TOKEN }} | |
| - name: Create release | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| name: "Ryubing UpdateServer V${{ steps.version_info.outputs.build_version }}" | |
| tag: ${{ steps.version_info.outputs.build_version }} | |
| draft: 'false' | |
| artifacts: "artifacts/*" | |
| body: "**[Changes since last build](https://github.com/Ryubing/UpdateServer/compare/${{ steps.version_info.outputs.prev_build_version }}...${{ steps.version_info.outputs.build_version }})**" | |
| omitBodyDuringUpdate: true | |
| owner: Ryubing | |
| repo: UpdateServer | |
| token: ${{ secrets.GITHUB_TOKEN }} |