name steps better #2
Workflow file for this run
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
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: Checkout MonoBehaviour | |
uses: actions/checkout@v4 | |
with: | |
ref: MonoBehaviour | |
path: MonoBehaviour | |
- 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: Install dependencies MonoBehaviour | |
run: dotnet restore | |
working-directory: MonoBehaviour | |
- name: Build master | |
run: dotnet build -c Release | |
working-directory: master | |
- name: Build MonoBehaviour | |
run: dotnet build -c Release | |
working-directory: MonoBehaviour | |
- name: Prepare master artifacts for release | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Publish-Master | |
path: master/bin/Publish | |
- name: Prepare MonoBehaviour artifacts for release | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Publish-MonoBehaviour | |
path: MonoBehaviour/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/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: v${{ steps.details.outputs.buildVersion }} | |
body: | | |
SHA256: ${{ steps.details.outputs.archiveHash }} | |
files: | | |
artifacts/Publish-Master/SFCore.dll | |
artifacts/Publish-Master/SFCore.zip | |
artifacts/Publish-MonoBehaviour/SFCoreUnity.dll |