Files
SnowcloakClient/.gitea/workflows/build.yml
Professor Fartsalot 2be5f5d320
Some checks are pending
.NET Build and Publish to Gitea / build (push) Waiting to run
MAYBE NOW IT WORKS?
2025-08-31 02:19:45 -04:00

62 lines
1.9 KiB
YAML

name: .NET Build and Publish to Gitea
on:
push:
branches: '*'
pull_request:
jobs:
build:
runs-on: self-hosted
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
- name: Verify .NET installation
run: dotnet --version
- name: Restore dependencies
run: dotnet restore
- name: Download Dalamud
run: |
mkdir -p $HOME/.xlcore/dalamud/Hooks/dev/
curl -L https://goatcorp.github.io/dalamud-distrib/stg/latest.zip -o latest.zip
unzip -o latest.zip -d $HOME/.xlcore/dalamud/Hooks/dev/
- name: Build project
run: dotnet build --no-restore --configuration Release --nologo
- name: Publish Windows self-contained executable
run: |
dotnet publish MareSynchronos.csproj \
-c Release \
-r win-x64 \
--self-contained true \
-o ./publish
- name: Archive published files
run: zip -r SnowcloakClient.zip ./publish/*
- name: Create Gitea release
env:
GITEA_TOKEN: ${{ secrets.build_snowcloak_client }}
run: |
API_URL="https://imbuilding.anuke.org/api/v1/repos/owner/repo/releases"
TAG="v$(date +%Y%m%d%H%M)"
# Create release
RELEASE_ID=$(curl -s -X POST \
-H "Content-Type: application/json" \
-H "Authorization: token $GITEA_TOKEN" \
-d "{\"tag_name\":\"$TAG\",\"name\":\"Automated Build $TAG\",\"body\":\"Automated build artifact\"}" \
$API_URL | jq -r '.id')
echo "Release ID: $RELEASE_ID"
# Upload asset
curl -s -X POST \
-H "Authorization: token $GITEA_TOKEN" \
-F "name=SnowcloakClient.zip" \
-F "attachment=@SnowcloakClient.zip" \
"$API_URL/$RELEASE_ID/assets"