Skip to content

Commit

Permalink
prepare for actions
Browse files Browse the repository at this point in the history
  • Loading branch information
SFGrenade committed Jan 3, 2025
1 parent eafde6f commit 62df733
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 2 deletions.
84 changes: 84 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Full Build

permissions:
contents: write

# Trigger when pushing tags
on:
push:
tags:
- '*'

jobs:
build:
runs-on: windows-latest

steps:
- name: Checkout master
uses: actions/checkout@v4
with:
ref: master
path: master

- name: Setup MAPI
uses: BadMagic100/setup-hk@v2
with:
apiPath: HkRefs
dependencyFilePath: master/ModDependencies.txt

- name: Setup .NET
uses: actions/setup-dotnet@v4

- name: Install dependencies master
run: dotnet restore
working-directory: master

- name: Build master
run: dotnet build -c Release
working-directory: master

- name: Prepare master artifacts for release
uses: actions/upload-artifact@v4
with:
name: Publish-Master
path: master/bin/Publish

release:
needs:
- build

runs-on: windows-latest

steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: artifacts

- name: Get build details
id: details
# this assumes that an MSBuild task that writes the SHA256 of the zip file to SHA.txt, and the mod version (usually
# the same as the assembly version) to version.txt. The contents of these files are read to step outputs for use in release
run: |
$sha = (Get-Content artifacts/Publish-Master/CustomBgm/SHA.txt)[3]
$ver = "${{ github.ref_name }}"
echo "archiveHash=$sha" >> $env:GITHUB_OUTPUT
echo "buildVersion=$ver" >> $env:GITHUB_OUTPUT
- name: Release
uses: softprops/action-gh-release@v2
with:
draft: false
generate_release_notes: true
fail_on_unmatched_files: true
tag_name: ${{ steps.details.outputs.buildVersion }}
body: |
SHA256 of CustomBgm.zip: ${{ steps.details.outputs.archiveHash }}
Attachments:
- CustomBgm.zip
- to be used for the ModInstaller
- CustomBgm.dll
- the mod, also inside CustomBgm.zip
files: |
artifacts/Publish-Master/CustomBgm/CustomBgm.zip
artifacts/Publish-Master/CustomBgm/CustomBgm.dll
5 changes: 3 additions & 2 deletions CustomBgm.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
<LangVersion>latest</LangVersion>
<PathMap>$(MSBuildProjectDirectory)=source</PathMap>
<AssemblyOriginatorKeyFile>../sgKey.snk</AssemblyOriginatorKeyFile>
<HollowKnightRefs />
<ExportDir />
<HollowKnightRefs>../HkRefs</HollowKnightRefs>
<ExportDir>bin/Publish</ExportDir>
<!--<GenerateDocumentationFile>true</GenerateDocumentationFile>-->
</PropertyGroup>
<Import Project="LocalOverrides.targets" Condition="Exists('LocalOverrides.targets')" />
Expand All @@ -33,6 +33,7 @@
<Folder Include="test" />
<None Include=".gitignore" />
<None Include="LICENSE" />
<None Include="ModDependencies.txt" />
<None Include="README.md" />
</ItemGroup>
<ItemGroup>
Expand Down
Empty file added ModDependencies.txt
Empty file.

0 comments on commit 62df733

Please sign in to comment.