From 101b8b54454f13bbb6c49fa88f4decc30b9907f7 Mon Sep 17 00:00:00 2001 From: Eauldane Date: Fri, 22 Aug 2025 12:15:27 +0100 Subject: [PATCH] WOrkflows --- .github/workflows/build.yml | 34 ++++++++++++++++++++++++++ .github/workflows/release.yml | 46 +++++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..7c2cb05 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,34 @@ +name: .NET Build + +on: + push: + branches: '*' + pull_request: + +jobs: + build: + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + with: + submodules: true + - name: Setup .NET + uses: actions/setup-dotnet@v1 + with: + dotnet-version: '9.x.x' + - name: Restore dependencies + run: dotnet restore + - name: Download Dalamud + run: | + Invoke-WebRequest -Uri https://goatcorp.github.io/dalamud-distrib/stg/latest.zip -OutFile latest.zip + Expand-Archive -Force latest.zip "$env:AppData\XIVLauncher\addon\Hooks\dev\" + - name: Build + run: | + dotnet build --no-restore --configuration Release --nologo + - name: Archive + run: Compress-Archive -Path MareSynchronos/bin/x64/Release/* -DestinationPath SnowcloakClient.zip + - name: Upload a Build Artifact + uses: actions/upload-artifact@v4 + with: + path: | + ./MareSynchronos/bin/x64/Release/* \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..fb3e203 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,46 @@ +name: Create Release + +on: + push: + tags: '*' + +jobs: + build: + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + with: + submodules: true + - name: Setup .NET + uses: actions/setup-dotnet@v1 + with: + dotnet-version: '9.x.x' + - name: Restore dependencies + run: dotnet restore + - name: Download Dalamud + run: | + Invoke-WebRequest -Uri https://goatcorp.github.io/dalamud-distrib/stg/latest.zip -OutFile latest.zip + Expand-Archive -Force latest.zip "$env:AppData\XIVLauncher\addon\Hooks\dev" + - name: Build + run: | + $ver = '${{ github.ref }}' -replace 'refs/tags/','' + invoke-expression 'dotnet build --no-restore --configuration Release --nologo -p:Version=$ver -p:FileVersion=$ver -p:AssemblyVersion=$ver' + - name: Archive + run: | + $ver = '${{ github.ref }}' -replace 'refs/tags/','' + Compress-Archive -Path MareSynchronos\bin\x64\Release\* -DestinationPath SnowcloakClient.zip + '{ "version": "' + $ver + '" }' | Out-File -FilePath '.\assets\mp3\manifest.json' + '{ "version": "' + $ver + '" }' | Out-File -FilePath '.\assets\ogg\manifest.json' + Compress-Archive -Path assets\mp3\* -DestinationPath assets-mp3.zip + Compress-Archive -Path assets\ogg\* -DestinationPath assets-ogg.zip + - name: Upload a Build Artifact + uses: actions/upload-artifact@v4 + with: + path: | + ./MareSynchronos/bin/x64/Release/* + - name: Upload Release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: ./*.zip + file_glob: true \ No newline at end of file