update workflow

This commit is contained in:
ppc
2026-01-09 21:05:15 +00:00
parent ded0109486
commit 572f5ed672
+18 -16
View File
@@ -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