Skip to content

Commit

Permalink
updates msbuild action
Browse files Browse the repository at this point in the history
  • Loading branch information
gynt committed Aug 14, 2024
1 parent 015fb76 commit c6d650e
Showing 1 changed file with 20 additions and 37 deletions.
57 changes: 20 additions & 37 deletions .github/workflows/msbuild.yml
Original file line number Diff line number Diff line change
@@ -1,57 +1,40 @@
name: Build modules
name: Build and release store

on:
# Trigger the workflow on push or pull request,
# but only for the main branch
workflow_dispatch

env:
# Path to the solution file relative to the root of the project.
SOLUTION_FILE_PATH: .
UCP3_DIR: UnofficialCrusaderPatch3-3.0.0
push

jobs:
build:
runs-on: windows-latest
strategy:
matrix:
build_configuration: [Release]
env:
BUILD_CONFIGURATION: ${{ matrix.build_configuration }}
BUILD_CONFIGURATION: ReleaseSecure
steps:
- name: Checkout private tools
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.UCP3_PRIVATE_REPO_READ_ACCESS }}
submodules: recursive

- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1.0.2
uses: microsoft/setup-msbuild@v2

- name: Run build script for UCP3 and the modules
- name: Prepare signing of modules by exporting secret to file
shell: pwsh
working-directory: ${{env.GITHUB_WORKSPACE}}
env:
UCP3_NUGET_TOKEN: ${{ secrets.UCP3_READ_PACKAGES }}
UCP3_SIGNING_CERTIFICATE_CONTENTS: ${{ secrets.UCP3_SIGNING_CERTIFICATE_CONTENTS }}
run: |
pushd "UnofficialCrusaderPatch3-*"
.\scripts\build.ps1 -What all -BuildType Release -NugetToken "$env:UCP3_NUGET_TOKEN"
popd
- name: Display ref name
Set-Content -Value "$env:UCP3_SIGNING_CERTIFICATE_CONTENTS" -Path "$($env:GITHUB_WORKSPACE)\ucp3-module-signing-key.pem" -Force
- name: Build store
shell: pwsh
env:
UCP3_NUGET_TOKEN: ${{ secrets.UCP3_READ_PACKAGES }}
run: |
echo $env:GITHUB_REF_NAME
echo $env:GITHUB_REF
.\scripts\build-store.ps1 -NugetToken "$env:UCP3_NUGET_TOKEN" -Certificate "$($env:GITHUB_WORKSPACE)\ucp3-module-signing-key.pem"
- name: Create release
uses: 'marvinpinto/action-automatic-releases@latest'
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
automatic_release_tag: '${{ github.ref_name }}-${{ env.BUILD_CONFIGURATION }}'
prerelease: true
draft: false
title: Build for ${{ github.ref_name }}
files: |
build/${{ env.BUILD_CONFIGURATION }}/meta.json
build/${{ env.BUILD_CONFIGURATION }}/meta.yml
build/${{ env.BUILD_CONFIGURATION }}/*.zip
build/${{ env.BUILD_CONFIGURATION }}/*.sig
- name: Release store
shell: pwsh
env:
UCP3_NUGET_TOKEN: ${{ secrets.UCP3_READ_PACKAGES }}
run: |
.\scripts\create-release.ps1

0 comments on commit c6d650e

Please sign in to comment.