Skip to content

Commit

Permalink
GHA tweaks - only build installer on v tag
Browse files Browse the repository at this point in the history
  • Loading branch information
megahirt committed Apr 19, 2024
1 parent b9621bc commit 0485e50
Showing 1 changed file with 9 additions and 20 deletions.
29 changes: 9 additions & 20 deletions .github/workflows/build-test-installer-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,17 @@ on:

jobs:
build-and-test:
name: Build and Run Tests
name: Build Debug and Run Tests
# note that the older .Net 4.6.1 isn't installed on windows-latest anymore
# see https://github.com/actions/runner-images/issues/5055
runs-on: windows-2019

steps:
- uses: actions/checkout@v4

- uses: microsoft/setup-msbuild@v2

# the caching mechanism below and the corresponding "if" conditions for nuget and TC dependencies is sort of a hack
# These deps never change so we cache them to speed up the GHA build. As we move to all deps in nuget, we should remove these lines
# and allow nuget to manage caching (remove "if" condition statements)
# and allow nuget to manage caching
- uses: actions/cache@v4
id: cache-nuget
with:
Expand Down Expand Up @@ -62,41 +60,35 @@ jobs:
shell: bash
run: find .

# tried but couldn't get NUnit tests running in GHA - cjh
# - name: Run NUnit Tests
# working-directory: output/x86/Debug
# run: ../../../NUnit.Runners.2.6.4/tools/nunit-console.exe ./SolidGui.Tests.dll

# clear output directory
# build for release ?

- name: Capture Build Artifacts
uses: actions/upload-artifact@v4
with:
name: solid-buildoutput
path: |
output/
lib/
if-no-files-found: error
retention-days: 1

build-installer:
name: Make Installer
name: Build Release And Make Installer
needs: build-and-test
if: startsWith(github.ref, 'refs/tags/v')
runs-on: windows-2019

steps:
- uses: actions/checkout@v4
- uses: microsoft/setup-msbuild@v2

# nuget and TC dependencies come from the cache
- uses: actions/cache@v4
with:
path: src\packages
key: ${{ runner.os }}-nuget-${{ hashFiles('src/SolidGui/packages.config') }} # hash of one packages.config (there are others)

- uses: actions/cache@v4
with:
path: lib
key: ${{ runner.os }}-teamcity-${{ hashFiles('build/getDependencies-windows.sh') }}

# nuget and TC dependencies come from the cache

- name: Build Solid for Release
run: msbuild /p:Configuration=Release src/solid.sln
Expand All @@ -120,14 +112,11 @@ jobs:
secrets:
certificate: ${{ secrets.CODESIGN_LSDEVSECTIGOEV }}


create-release:
name: Create Release
needs: sign-installer

runs-on: windows-latest

if: startsWith(github.ref, 'refs/tags/v')
runs-on: windows-latest

steps:
- uses: actions/download-artifact@v4
Expand Down

0 comments on commit 0485e50

Please sign in to comment.