Skip to content

Commit

Permalink
build: include config tool in the release
Browse files Browse the repository at this point in the history
  • Loading branch information
rr- committed Oct 19, 2022
1 parent 11e28c2 commit 027dcba
Show file tree
Hide file tree
Showing 3 changed files with 118 additions and 18 deletions.
90 changes: 78 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
needs: [build_game, build_installer]
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
path: .
fetch-depth: 0
Expand All @@ -45,7 +45,7 @@ jobs:
uses: actions/download-artifact@v1
with:
path: artifacts/
name: game
name: game_all

- name: Download built installer asset
uses: actions/download-artifact@v1
Expand All @@ -63,14 +63,19 @@ jobs:
mv artifacts/Tomb1Main_Installer.exe artifacts/Tomb1Main-${{ steps.get_version.outputs.VERSION }}-Installer.exe
- name: Generate Changelog
run: python3 -c 'from pathlib import Path; print(Path("CHANGELOG.md").read_text().split("\n\n")[1])' | tail -n -1 > artifacts/changes.txt
run: |
python3 -c '''
import re
from pathlib import Path
section = [s for s in Path("CHANGELOG.md").read_text().split("\n\n") if re.search("- \w", s)][0]
print("\n".join(line for line in section.splitlines() if not line.startswith("#")))
''' > artifacts/changes.txt
- name: Release
uses: softprops/action-gh-release@v1
#if: startsWith(github.ref, 'refs/tags/')
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: Release ${{ github.ref }}
name: Release ${{ github.ref_name }}
body_path: artifacts/changes.txt
draft: ${{ inputs.draft }}
prerelease: ${{ inputs.prerelease }}
Expand All @@ -79,38 +84,99 @@ jobs:
artifacts/Tomb1Main-${{ steps.get_version.outputs.VERSION }}.zip
artifacts/Tomb1Main-${{ steps.get_version.outputs.VERSION }}-Installer.exe
build_configurator:
name: Build the configurator
runs-on: windows-latest # https://github.com/dotnet/runtime/issues/3828
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
path: .
fetch-depth: 0

- name: Setup dependencies
uses: actions/setup-dotnet@v2
with:
dotnet-version: '6.0'

- name: Build
run: |
cd tools/config/
dotnet restore
dotnet publish -c Release -o out
- name: Upload the artifact
uses: actions/upload-artifact@v1
with:
name: configtool
path: tools/config/out/Tomb1Main_ConfigTool.exe

build_game:
name: Build the game
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
path: .
fetch-depth: 0

- name: Install dependencies
run: |
echo "$GITHUB_CONTEXT"
sudo apt-get update
sudo apt-get install -y make p7zip-full moby-engine moby-cli
sudo apt-get install -y make moby-engine moby-cli
- name: Build the game
run: |
make clean release
mkdir out/
cp build/*.exe out/
cp -r bin/* out/
- name: Upload the artifact
uses: actions/upload-artifact@v1
with:
name: game
path: out/

package_game:
name: Package the game
needs: [build_game, build_configurator]
runs-on: ubuntu-latest
steps:
- name: Download built config tool assets
uses: actions/download-artifact@v1
with:
path: artifacts/
name: configtool

- name: Download built game assets
uses: actions/download-artifact@v1
with:
path: artifacts/
name: game

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y make p7zip-full
- name: Package the game
run: |
7z a game.zip ./bin/* ./build/*.exe
mkdir out
cd artifacts
7z a ../out/game.zip *
- name: Upload the artifact
uses: actions/upload-artifact@v1
with:
name: game
path: game.zip
name: game_all
path: out/game.zip

build_installer:
name: Build the installer
needs: [build_game]
needs: [package_game]
runs-on: windows-latest # https://github.com/dotnet/runtime/issues/3828
steps:
- name: Checkout code
Expand All @@ -123,7 +189,7 @@ jobs:
uses: actions/download-artifact@v1
with:
path: artifacts/
name: game
name: game_all

- name: Setup dependencies
uses: actions/setup-dotnet@v2
Expand Down
31 changes: 31 additions & 0 deletions tools/config/Tomb1Main_ConfigTool.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.1.32407.343
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tomb1Main_ConfigTool", "Tomb1Main_ConfigTool\Tomb1Main_ConfigTool.csproj", "{DCFCB544-9B88-41D6-A995-EA2D06FE405E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{DCFCB544-9B88-41D6-A995-EA2D06FE405E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DCFCB544-9B88-41D6-A995-EA2D06FE405E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DCFCB544-9B88-41D6-A995-EA2D06FE405E}.Debug|x64.ActiveCfg = Debug|x64
{DCFCB544-9B88-41D6-A995-EA2D06FE405E}.Debug|x64.Build.0 = Debug|x64
{DCFCB544-9B88-41D6-A995-EA2D06FE405E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DCFCB544-9B88-41D6-A995-EA2D06FE405E}.Release|Any CPU.Build.0 = Release|Any CPU
{DCFCB544-9B88-41D6-A995-EA2D06FE405E}.Release|x64.ActiveCfg = Release|x64
{DCFCB544-9B88-41D6-A995-EA2D06FE405E}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {49C0A7F4-2D17-424B-BD94-A8FC6E95931D}
EndGlobalSection
EndGlobal
15 changes: 9 additions & 6 deletions tools/config/Tomb1Main_ConfigTool/Tomb1Main_ConfigTool.csproj
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<Nullable>disable</Nullable>
<UseWPF>true</UseWPF>
<UseWpf>true</UseWpf>
<UseWindowsForms>true</UseWindowsForms>

<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<AssemblyName>Tomb1Main_ConfigTool</AssemblyName>
<ApplicationIcon>Resources\icon.ico</ApplicationIcon>
<AssemblyName>Tomb1Main_ConfigTool</AssemblyName>
<ProduceReferenceAssembly>True</ProduceReferenceAssembly>
<ApplicationManifest>app.manifest</ApplicationManifest>

<PublishSingleFile>true</PublishSingleFile>
<PublishTrimmed>false</PublishTrimmed>
<PublishReadyToRun>true</PublishReadyToRun>
<EnableCompressionInSingleFile>false</EnableCompressionInSingleFile>
<SelfContained>false</SelfContained>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<ApplicationIcon>Resources\icon.ico</ApplicationIcon>
</PropertyGroup>

<ItemGroup>
Expand All @@ -29,7 +32,7 @@
<None Remove="Resources\Lang\en-GB.json" />
<EmbeddedResource Include="Resources\Lang\en-GB.json" />
</ItemGroup>

<ItemGroup>
<None Remove="Resources\arrow-down.png" />
<None Remove="Resources\arrow-up.png" />
Expand Down Expand Up @@ -72,4 +75,4 @@
</Resource>
<Resource Include="Resources\Tomb1Main.png" />
</ItemGroup>
</Project>
</Project>

0 comments on commit 027dcba

Please sign in to comment.