1
+ name : Build and Publish
2
+
3
+ on :
4
+ push :
5
+ branches : main
6
+ pull_request :
7
+
8
+ jobs :
9
+ build :
10
+ name : Build and create release
11
+ runs-on : ubuntu-latest
12
+ steps :
13
+ - name : Checkout
14
+ uses : actions/checkout@v2
15
+
16
+ - name : Fetch Unity Engine modules
17
+ run : |
18
+ wget https://files.catbox.moe/i4sdl6.zip -O UnityModules.zip
19
+ unzip UnityModules.zip -d Mod/References
20
+
21
+ - name : Fetch API files
22
+ run : |
23
+ wget https://github.com/hk-modding/api/releases/latest/download/ModdingApiWin.zip -O API.zip
24
+ unzip -o API.zip -d Mod/References
25
+
26
+ - name : Fetch a dependency
27
+ run : |
28
+ wget https://github.com/fifty-six/HollowKnight.Vasi/releases/download/v2/Vasi.zip -O Vasi.zip
29
+ unzip -o Vasi.zip -d Mod/References
30
+
31
+ - name : Setup MSBuild
32
+ run : sudo apt-get install -y nuget mono-devel mono-xbuild
33
+
34
+ - name : Restore packages
35
+ run : nuget restore Mod/AnyRadiance.csproj
36
+
37
+ - name : Build project
38
+ run : dotnet build --configuration Release Mod/AnyRadiance.csproj
39
+
40
+ - name : Get SHA256 of zipped mod
41
+ id : get_hash
42
+ run : echo "::set-output name=hash::$(sha256sum Mod/Output/AnyRadiance.zip | cut -d ' ' -f 1)"
43
+
44
+ - name : Get Assembly version
45
+ id : get_version
46
+ run : echo "::set-output name=version::$(cat < Mod/Version.txt)"
47
+
48
+ - name : Create release
49
+ id : create_release
50
+ uses : actions/create-release@v1
51
+ env :
52
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
53
+ with :
54
+ tag_name : ${{ steps.get_version.outputs.version }}
55
+ release_name : Release v${{ steps.get_version.outputs.version }}
56
+ body : " SHA256: ${{ steps.get_hash.outputs.hash }}"
57
+ draft : false
58
+ prerelease : false
59
+
60
+ - name : Upload release asset
61
+ uses : actions/upload-release-asset@v1
62
+ env :
63
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
64
+ with :
65
+ upload_url : ${{ steps.create_release.outputs.upload_url }}
66
+ asset_path : Mod/Output/AnyRadiance.zip
67
+ asset_name : AnyRadiance.zip
68
+ asset_content_type : application/zip
0 commit comments