-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added git workflow build. Updated GitVersionTask. Added script to bui…
…ld release zip. Added user file template.
- Loading branch information
Showing
5 changed files
with
111 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
on: push | ||
name: Release Build | ||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
#runs-on: ubuntu-latest # missing .NET 4.6 Framework | ||
steps: | ||
- name: Download Build Dependencies | ||
shell: bash | ||
env: | ||
MANAGED_ARCHIVE_PW: ${{ secrets.MANAGED_ARCHIVE_PW }} | ||
MANAGED_ARCHIVE_URL: ${{ secrets.MANAGED_ARCHIVE_URL }} | ||
run: | | ||
set -e | ||
curl -L -o "$GITHUB_WORKSPACE/Managed.7z" "$MANAGED_ARCHIVE_URL" | ||
7z e -p"$MANAGED_ARCHIVE_PW" -o"$GITHUB_WORKSPACE/deps" "$GITHUB_WORKSPACE/Managed.7z" | ||
- name: Checkout CustomComponents | ||
uses: actions/checkout@master | ||
with: | ||
repository: BattletechModders/CustomComponents | ||
ref: Experimental | ||
path: CustomComponents/ | ||
- name: Fetch CustomComponents Branches and Tags | ||
shell: bash | ||
run: | | ||
cd CustomComponents/ | ||
git fetch --prune --unshallow | ||
- name: Setup dotnet | ||
uses: actions/setup-dotnet@master | ||
with: | ||
dotnet-version: '5.0.x' | ||
- name: Build Release | ||
shell: bash | ||
env: | ||
MSBUILDSINGLELOADCONTEXT: 1 # workaround for GitVersionTask | ||
run: | | ||
set -e | ||
cd "$GITHUB_WORKSPACE/CustomComponents/" | ||
./release.sh "-p:ReferencePath=$GITHUB_WORKSPACE/deps" | ||
- name: Upload Build | ||
uses: actions/upload-artifact@master | ||
with: | ||
name: dist | ||
path: "./CustomComponents/dist/CustomComponents.zip" | ||
|
||
release: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
if: contains(github.ref, 'refs/tags') | ||
steps: | ||
- name: Download Build | ||
uses: actions/download-artifact@master | ||
with: | ||
name: dist | ||
path: . | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: ${{ github.ref }} | ||
draft: false | ||
prerelease: false | ||
body: | | ||
Works with ModLoader and ModTek | ||
- CustomComponents.zip contains the compiled framework | ||
- name: Upload Release Asset | ||
id: upload-release-asset | ||
uses: actions/upload-release-asset@master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: CustomComponents.zip | ||
asset_name: CustomComponents.zip | ||
asset_content_type: application/zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
# DynModLib specific ignores | ||
log.txt | ||
/*.dll | ||
/dist | ||
|
||
# User-specific files | ||
*.suo | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
export PATH="/c/Program Files/7-Zip/:$PATH" | ||
|
||
SEVENZIP="7z" | ||
|
||
set -ex | ||
|
||
CCZIP="CustomComponents/dist/CustomComponents.zip" | ||
rm -f "$CCZIP" | ||
|
||
cd .. | ||
|
||
( | ||
cd CustomComponents/source | ||
#git describe --exact-match | ||
dotnet build --configuration Release --no-incremental -p:OutputPath=../ "$@" | ||
) | ||
|
||
( | ||
INCLUDES="-i!CustomComponents/CustomComponents.dll -i!CustomComponents/LICENSE -i!CustomComponents/mod.json -i!CustomComponents/mod.minimal.json -i!CustomComponents/README.md" | ||
|
||
"$SEVENZIP" a -tzip -mx9 "$CCZIP" $INCLUDES | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<ReferencePath>C:\Program Files\Steam\steamapps\common\BATTLETECH\BattleTech_Data\Managed</ReferencePath> | ||
<OutputPath>..\</OutputPath> | ||
</PropertyGroup> | ||
</Project> |