Skip to content

Commit

Permalink
ci: 👷
Browse files Browse the repository at this point in the history
  • Loading branch information
esnya committed Dec 12, 2024
1 parent f6bce8b commit 6fbf269
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions .github/workflows/dotnet-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@ name: .NET Build

on:
push:
branches: ["master"]
branches: ["master", "feature/ci"]
create:
tags:
- 'v*'

env:
AppId: 2519830
ProjectName: ResoniteMetricsCounter
ArtifactName: ResoniteMetricsCounter.dll
ArtifactDLL: ResoniteMetricsCounter.dll
Configuration: Release

jobs:
build:
Expand All @@ -21,43 +23,44 @@ jobs:
- name: Setup SteamCMD
uses: CyberAndrii/[email protected]

- name: Checkout
- id: checkout
name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Cache app
uses: actions/cache@v4
with:
path: ${{ env.ProjectName }}/Resonite/
path: ${{ steps.checkout.outputs.repositoryPath }}/${{ env.ProjectName }}/Resonite/
key: app-runtime-2

- name: Update app
run: steamcmd +force_install_dir ${{ env.ProjectName }}/Resonite +login ${{ secrets.STEAMLOGIN }} +app_update 2519830 validate +quit
run: steamcmd +force_install_dir ${{ steps.checkout.outputs.repositoryPath }}/${{ env.ProjectName }}/Resonite +login ${{ secrets.STEAMLOGIN }} +app_update ${{ env.AppId }} validate +quit

- name: Install ResoniteModLoader
uses: suisei-cn/actions-download-file@v1
with:
url: https://github.com/resonite-modding-group/ResoniteModLoader/releases/latest/download/ResoniteModLoader.dll
target: ${{ env.ProjectName }}/Resonite/Libraries/
target: ${{ steps.checkout.outputs.repositoryPath }}/${{ env.ProjectName }}/Resonite/Libraries/

- name: Install Harmony
uses: suisei-cn/actions-download-file@v1
with:
url: https://github.com/resonite-modding-group/ResoniteModLoader/releases/latest/download/0Harmony.dll
target: ${{ env.ProjectName }}/Resonite/rml_libs/
target: ${{ steps.checkout.outputs.repositoryPath }}/${{ env.ProjectName }}/Resonite/rml_libs/

- name: Restore the application
run: msbuild /t:Restore /p:Configuration=RELEASE
run: msbuild /t:Restore /p:Configuration=${{ env.Configuration }}

- name: Create the app package
run: msbuild /p:Configuration=RELEASE
run: msbuild /p:Configuration=${{ env.Configuration }}

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.ArtifactName }}.dll
path: ${{ env.ProjectName }}/bin/Release/net472/${{ env.ArtifactName }}.dll
name: ${{ env.ArtifactDLL }}
path: ${{ env.ProjectName }}/bin/Release/net472/${{ env.ArtifactDLL }}

release:
if: startsWith(github.ref, 'refs/tags/v')
Expand All @@ -71,10 +74,10 @@ jobs:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: ${{ env.ArtifactName }}.dll
name: ${{ env.ArtifactDLL }}
- name: Release
uses: softprops/action-gh-release@v2
with:
files: |
*.dll
${{ env.ArtifactDLL }}
generate_release_notes: true

0 comments on commit 6fbf269

Please sign in to comment.