Skip to content

Commit

Permalink
[workflow] Only install dotnet when cache is missed
Browse files Browse the repository at this point in the history
whoops
  • Loading branch information
bagusnl authored Jul 29, 2023
1 parent 5a28c4d commit d1dfdac
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ on:
- "net7.0-windows10.0.22000.0"
- "net7.0-windows10.0.19041.0"



jobs:

build:
runs-on: ${{ github.event.inputs.os }}
strategy:
Expand All @@ -39,7 +36,6 @@ jobs:
Platform: ${{ matrix.platform }}
DOTNET_INSTALL_DIR: '.\.dotnet'


steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -49,8 +45,8 @@ jobs:
- name: Get short Git SHA
id: vars
run: |
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
- name: Cache dotnet # cache dotnet install https://stackoverflow.com/questions/75180149/how-to-cache-dotnet-installation-in-github-actions
id: cache-dotnet
Expand All @@ -69,6 +65,7 @@ jobs:
${{ runner.os }}-nuget-
- name: Install .NET
if: ${{ steps.cache-dotnet.outputs.cache-hit != 'true' }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
Expand All @@ -95,5 +92,5 @@ jobs:
uses: actions/[email protected]
if: ${{ matrix.configuration == 'Release' }}
with:
name: collapse_${{ steps.vars.outputs.branch }}_${{ steps.vars.outputs.sha_short }}.${{ matrix.platform }}-${{ matrix.configuration }}_${{ github.event.inputs.framework }}
name: collapse_${{ env.branch }}_${{ env.sha_short }}.${{ matrix.platform }}-${{ matrix.configuration }}_${{ github.event.inputs.framework }}
path: ./CollapseLauncher/bin/x64/Release/${{ github.event.inputs.framework }}/

0 comments on commit d1dfdac

Please sign in to comment.