diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index f9753a3677..88fa3a7364 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -2351,64 +2351,11 @@ jobs: asset_content_type: application/octet-stream update-nix: - name: Update Nix SHA + name: Nix Deployment needs: changelog-regen - runs-on: ubuntu-latest if: (!(cancelled() || failure())) && needs.changelog-regen.result == 'success' - steps: - - name: Install Native Packages # Name checked in rerunFlakyTests.js - run: | - sudo apt-get update - sudo apt-get install -y xmlstarlet - - - name: Setup Nix - uses: cachix/install-nix-action@v30 - with: - nix_path: nixpkgs=channel:nixos-unstable - - - name: Generate App Token - id: app-token-generation - uses: actions/create-github-app-token@v1 - with: - repositories: tgstation-ppa - app-id: ${{ secrets.APP_ID }} - private-key: ${{ secrets.APP_PRIVATE_KEY }} - - - name: Clone - run: git clone -b master --single-branch "https://tgstation-server-ci:${{ steps.app-token-generation.outputs.token }}@github.com/tgstation/tgstation-server" --depth 1 . - - - name: Parse TGS version - run: echo "TGS_VERSION=$(xmlstarlet sel -N X="http://schemas.microsoft.com/developer/msbuild/2003" --template --value-of /X:Project/X:PropertyGroup/X:TgsCoreVersion build/Version.props)" >> $GITHUB_ENV - - - name: Retrieve ServerConsole.zip Artifact - uses: actions/download-artifact@v4 - with: - name: server-console-release - path: server-console-release - - - name: Regenerate Nix Hash - run: | - nix hash path ./server-console-release > build/package/nix/ServerConsole.sha256 - cat build/package/nix/ServerConsole.sha256 - - - name: Commit - run: | - git config --global push.default simple - git config user.name "tgstation-server-ci[bot]" - git config user.email "161980869+tgstation-server-ci[bot]@users.noreply.github.com" - git add build/package/nix/ServerConsole.sha256 - git commit -m "Update nix SHA256 for TGS v${{ env.TGS_VERSION }}" - - - name: Re-tag - run: | - git tag -d tgstation-server-v${{ env.TGS_VERSION }} - git tag -a tgstation-server-v${{ env.TGS_VERSION }} -m tgstation-server-v${{ env.TGS_VERSION }} - - - name: Push Commit - run: git push "https://tgstation-server-ci:${{ steps.app-token-generation.outputs.token }}@github.com/tgstation/tgstation-server" - - - name: Force Push Tags - run: git push -f origin tag tgstation-server-v${{ env.TGS_VERSION }} + uses: ./.github/workflows/nix-deployment.yml + secrets: inherit changelog-regen: name: Regenerate Changelog diff --git a/.github/workflows/nix-deployment.yml b/.github/workflows/nix-deployment.yml new file mode 100644 index 0000000000..a61fa13237 --- /dev/null +++ b/.github/workflows/nix-deployment.yml @@ -0,0 +1,68 @@ +name: Nix Deployment + +on: + workflow_call: + workflow_dispatch: + +jobs: + update-nix: + name: Update Nix SHA (master) + runs-on: ubuntu-latest + steps: + - name: Install Native Packages # Name checked in rerunFlakyTests.js + run: | + sudo apt-get update + sudo apt-get install -y xmlstarlet + + - name: Setup Nix + uses: cachix/install-nix-action@v30 + with: + nix_path: nixpkgs=channel:nixos-unstable + + - name: Generate App Token + id: app-token-generation + uses: actions/create-github-app-token@v1 + with: + app-id: ${{ secrets.APP_ID }} + private-key: ${{ secrets.APP_PRIVATE_KEY }} + + - name: Checkout + uses: actions/checkout@v4 + with: + token: ${{ steps.app-token-generation.outputs.token }} + ref: master + fetch-depth: 0 + # fetch-tags: true Doesn't work, see https://github.com/actions/checkout/issues/1471 + + - name: Parse TGS version + run: echo "TGS_VERSION=$(xmlstarlet sel -N X="http://schemas.microsoft.com/developer/msbuild/2003" --template --value-of /X:Project/X:PropertyGroup/X:TgsCoreVersion build/Version.props)" >> $GITHUB_ENV + + - name: Retrieve ServerConsole.zip Artifact + run: | + curl -L https://github.com/tgstation/tgstation-server/releases/download/tgstation-server-v${{ env.TGS_VERSION }}/ServerConsole.zip -f -o ServerConsole.zip + unzip ServerConsole.zip -d release + + - name: Regenerate Nix Hash + run: | + nix hash path ./release > build/package/nix/ServerConsole.sha256 + cat build/package/nix/ServerConsole.sha256 + rm -rf ./release ServerConsole.zip + + - name: Commit + run: | + git config --global push.default simple + git config user.name "tgstation-server-ci[bot]" + git config user.email "161980869+tgstation-server-ci[bot]@users.noreply.github.com" + git add build/package/nix/ServerConsole.sha256 + git commit -m "Update nix SHA256 for TGS v${{ env.TGS_VERSION }}" + + - name: Re-tag + run: | + git tag -d tgstation-server-v${{ env.TGS_VERSION }} + git tag -a tgstation-server-v${{ env.TGS_VERSION }} -m tgstation-server-v${{ env.TGS_VERSION }} + + - name: Push Commit + run: git push + + - name: Force Push Tags + run: git push -f origin tag tgstation-server-v${{ env.TGS_VERSION }} diff --git a/build/WebpanelVersion.props b/build/WebpanelVersion.props index ba17bc8c08..c1a42663e6 100644 --- a/build/WebpanelVersion.props +++ b/build/WebpanelVersion.props @@ -1,6 +1,6 @@ - 6.9.5 + 6.10.0 diff --git a/build/package/nix/ServerConsole.sha256 b/build/package/nix/ServerConsole.sha256 index 985170eb14..e51913ebeb 100644 --- a/build/package/nix/ServerConsole.sha256 +++ b/build/package/nix/ServerConsole.sha256 @@ -1 +1 @@ -sha256-6Wkdb1U2Xmw239zKJTbKcStdAV/G7aMa2oeCsGaSucA= +sha256-LX9Hq1pefHFWlzncaRW+OCmxBQeCxn0g+p3eE3UCeMs= diff --git a/build/package/nix/tgstation-server.nix b/build/package/nix/tgstation-server.nix index 6079ea037f..3b44da3309 100644 --- a/build/package/nix/tgstation-server.nix +++ b/build/package/nix/tgstation-server.nix @@ -162,8 +162,9 @@ in ]; restartIfChanged = false; # So that the TGS service doesn't just get restarted whenever it's updated, and boots players wantedBy = [ "multi-user.target" ]; + wants = [ "network-online.target" ]; after = [ - "network.target" + "network-online.target" "mysql.service" "mariadb.service" "postgresql.service" diff --git a/build/tgstation-server.service b/build/tgstation-server.service index 44ce74fe2e..02528a8433 100644 --- a/build/tgstation-server.service +++ b/build/tgstation-server.service @@ -1,6 +1,7 @@ [Unit] Description=tgstation-server -After=network.target +Wants=network-online.target +After=network-online.target After=mysql.service After=mariadb.service After=postgresql.service diff --git a/src/Tgstation.Server.Api/Tgstation.Server.Api.csproj b/src/Tgstation.Server.Api/Tgstation.Server.Api.csproj index 56fc5580cb..d5a111921d 100644 --- a/src/Tgstation.Server.Api/Tgstation.Server.Api.csproj +++ b/src/Tgstation.Server.Api/Tgstation.Server.Api.csproj @@ -28,7 +28,7 @@ - + diff --git a/src/Tgstation.Server.Common/Tgstation.Server.Common.csproj b/src/Tgstation.Server.Common/Tgstation.Server.Common.csproj index 575f74697b..97766617d4 100644 --- a/src/Tgstation.Server.Common/Tgstation.Server.Common.csproj +++ b/src/Tgstation.Server.Common/Tgstation.Server.Common.csproj @@ -12,7 +12,7 @@ - + diff --git a/src/Tgstation.Server.Host/.config/dotnet-tools.json b/src/Tgstation.Server.Host/.config/dotnet-tools.json index bc2098a53b..76e6bce7b3 100644 --- a/src/Tgstation.Server.Host/.config/dotnet-tools.json +++ b/src/Tgstation.Server.Host/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "dotnet-ef": { - "version": "9.0.3", + "version": "9.0.4", "commands": [ "dotnet-ef" ] diff --git a/src/Tgstation.Server.Host/Tgstation.Server.Host.csproj b/src/Tgstation.Server.Host/Tgstation.Server.Host.csproj index 7d80a48166..71d96b9f65 100644 --- a/src/Tgstation.Server.Host/Tgstation.Server.Host.csproj +++ b/src/Tgstation.Server.Host/Tgstation.Server.Host.csproj @@ -118,19 +118,19 @@ - + - + runtime; build; native; contentfiles; analyzers; buildtransitive - + - + - + - + @@ -156,13 +156,13 @@ - + - + - + diff --git a/tests/Tgstation.Server.Host.Tests/Tgstation.Server.Host.Tests.csproj b/tests/Tgstation.Server.Host.Tests/Tgstation.Server.Host.Tests.csproj index 976f644e52..b6cb2167ad 100644 --- a/tests/Tgstation.Server.Host.Tests/Tgstation.Server.Host.Tests.csproj +++ b/tests/Tgstation.Server.Host.Tests/Tgstation.Server.Host.Tests.csproj @@ -7,7 +7,7 @@ - +