Skip to content

Commit

Permalink
ci: 👷 Use custom action
Browse files Browse the repository at this point in the history
  • Loading branch information
esnya committed Dec 18, 2024
1 parent ac8d632 commit 83ab9db
Showing 1 changed file with 10 additions and 39 deletions.
49 changes: 10 additions & 39 deletions .github/workflows/dotnet-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@ on:
- 'v*'

env:
AppId: 2519830
ProjectName: ResoniteMetricsCounter
ArtifactDLL: ResoniteMetricsCounter.dll
Configuration: Release
project: ResoniteMetricsCounter
artifact: ResoniteMetricsCounter.dll

jobs:
vtag:
Expand Down Expand Up @@ -55,50 +53,23 @@ jobs:
build:
runs-on: windows-latest
steps:
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v2

- name: Setup SteamCMD
uses: CyberAndrii/[email protected]

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

- name: Cache app
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/${{ env.ProjectName }}/Resonite/
key: app-runtime-2

- name: Update app
run: steamcmd +force_install_dir ${{ github.workspace }}/${{ env.ProjectName }}/Resonite +login ${{ secrets.STEAMLOGIN }} +app_update ${{ env.AppId }} validate +quit

- name: Install ResoniteModLoader
uses: suisei-cn/actions-download-file@v1
- name: Build
uses: esnya/build-rml-mod@v1
with:
url: https://github.com/resonite-modding-group/ResoniteModLoader/releases/latest/download/ResoniteModLoader.dll
target: ${{ github.workspace }}/${{ 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: ${{ github.workspace }}/${{ env.ProjectName }}/Resonite/rml_libs/

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

- name: Create the app package
run: msbuild /p:Configuration=${{ env.Configuration }}
project: ${{ env.project }}
steam-login: ${{ secrets.STEAMLOGIN }}

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

release:
if: startsWith(github.ref, 'refs/tags/v') || needs.vtag.outputs.tagged
Expand All @@ -115,11 +86,11 @@ jobs:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: ${{ env.ArtifactDLL }}
name: ${{ env.artifact }}
- name: Release
uses: softprops/action-gh-release@v2
with:
files: |
${{ env.ArtifactDLL }}
${{ env.artifact }}
generate_release_notes: true
tag_name: ${{ needs.vtag.outputs.tagged && needs.vtag.outputs.tag || github.ref }}

0 comments on commit 83ab9db

Please sign in to comment.