From 572f5ed672d0fa5084560dc68aa6a5bfec894994 Mon Sep 17 00:00:00 2001 From: ppc Date: Fri, 9 Jan 2026 21:05:15 +0000 Subject: [PATCH] update workflow --- .github/workflows/release.yml | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ea06b6a..50e13f0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,9 +1,6 @@ name: Release on: - # push: - # tags: - # - '^v?(?:[0-9]+.?){1,4}$' workflow_dispatch: inputs: tag: @@ -33,26 +30,31 @@ jobs: needs: get-upload-url name: Build amnet-server - env: - DOTNET_CLI_TELEMETRY_OPTOUT: 1 + strategy: + matrix: + include: + - { target: "x86_64-pc-windows-msvc", filename: "amnet.dll", include_test_server: true } + - { target: "i686-pc-windows-msvc", filename: "amnet_x86.dll", include_test_server: false } steps: - uses: actions/checkout@v4 - - uses: actions/setup-dotnet@v4 - with: - dotnet-version: '9.0.x' - - - name: Set version + + - name: Set target run: | - $tag="${{ github.event.inputs.tag || github.ref_name }}".TrimStart("v") - echo "VERSION=$tag" >> $env:GITHUB_ENV + rustup target add ${{ matrix.target }} + rustup set default-host ${{ matrix.target }} - - name: Publish - run: dotnet publish -c Release -r win-x64 -o .\build-out -p:Version=$env:VERSION AMNet.Server\AMNet.Server.csproj + - name: Perform build + run: cargo build --release - - name: Upload artifact + - name: Upload .dll run: | - curl -s -X POST -H "Authorization: token ${{ secrets.GITEA_TOKEN }}" -H "Content-Type: application/octet-stream" --data-binary "@.\build-out\amnet.dll" "${{ needs.get-upload-url.outputs.upload_url }}?name=amnet.dll" + curl -s -X POST -H "Authorization: token ${{ secrets.GITEA_TOKEN }}" -H "Content-Type: application/octet-stream" --data-binary "@.\amnet-server\target\release\amnet.dll" "${{ needs.get-upload-url.outputs.upload_url }}?name=${{ matrix.filename }}" + + - name: Upload test server + if: "matrix.include_test_server" + run: | + curl -s -X POST -H "Authorization: token ${{ secrets.GITEA_TOKEN }}" -H "Content-Type: application/octet-stream" --data-binary "@.\amnet-server\target\release\amnet-server-test.exe" "${{ needs.get-upload-url.outputs.upload_url }}?name=amnet-server.exe" build-website: runs-on: ubuntu-latest