mirror of
https://github.com/actions/runner.git
synced 2025-12-13 18:33:52 +00:00
Switch to numerical update check as bools aren't processing correct
This commit is contained in:
16
.github/workflows/build.yml
vendored
16
.github/workflows/build.yml
vendored
@@ -68,19 +68,19 @@ jobs:
|
|||||||
echo "Current dotnet runtime hash result: $DOTNET_RUNTIME_HASH"
|
echo "Current dotnet runtime hash result: $DOTNET_RUNTIME_HASH"
|
||||||
echo "Current Externals hash result: $EXTERNALS_HASH"
|
echo "Current Externals hash result: $EXTERNALS_HASH"
|
||||||
|
|
||||||
NeedUpdate=false
|
NeedUpdate=0
|
||||||
if [ "$EXTERNALS_HASH" != "$(cat ./src/Misc/contentHash/externals/${{ matrix.runtime }})" ] ;then
|
if [ "$EXTERNALS_HASH" != "$(cat ./src/Misc/contentHash/externals/${{ matrix.runtime }})" ] ;then
|
||||||
echo Hash mismatch, Update ./src/Misc/contentHash/externals/${{ matrix.runtime }} to $EXTERNALS_HASH
|
echo Hash mismatch, Update ./src/Misc/contentHash/externals/${{ matrix.runtime }} to $EXTERNALS_HASH
|
||||||
|
|
||||||
echo "EXTERNAL_HASH=$EXTERNALS_HASH" >> $GITHUB_OUTPUT
|
echo "EXTERNAL_HASH=$EXTERNALS_HASH" >> $GITHUB_OUTPUT
|
||||||
NeedUpdate=true
|
NeedUpdate=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$DOTNET_RUNTIME_HASH" != "$(cat ./src/Misc/contentHash/dotnetRuntime/${{ matrix.runtime }})" ] ;then
|
if [ "$DOTNET_RUNTIME_HASH" != "$(cat ./src/Misc/contentHash/dotnetRuntime/${{ matrix.runtime }})" ] ;then
|
||||||
echo Hash mismatch, Update ./src/Misc/contentHash/dotnetRuntime/${{ matrix.runtime }} to $DOTNET_RUNTIME_HASH
|
echo Hash mismatch, Update ./src/Misc/contentHash/dotnetRuntime/${{ matrix.runtime }} to $DOTNET_RUNTIME_HASH
|
||||||
|
|
||||||
echo "DOTNET_RUNTIME_HASH=$DOTNET_RUNTIME_HASH" >> $GITHUB_OUTPUT
|
echo "DOTNET_RUNTIME_HASH=$DOTNET_RUNTIME_HASH" >> $GITHUB_OUTPUT
|
||||||
NeedUpdate=true
|
NeedUpdate=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "NEED_UPDATE=$NeedUpdate" >> $GITHUB_OUTPUT
|
echo "NEED_UPDATE=$NeedUpdate" >> $GITHUB_OUTPUT
|
||||||
@@ -88,7 +88,7 @@ jobs:
|
|||||||
DOTNET_RUNTIME_HASH: ${{hashFiles('**/_layout_trims/runtime/**/*')}}
|
DOTNET_RUNTIME_HASH: ${{hashFiles('**/_layout_trims/runtime/**/*')}}
|
||||||
EXTERNALS_HASH: ${{hashFiles('**/_layout_trims/externals/**/*')}}
|
EXTERNALS_HASH: ${{hashFiles('**/_layout_trims/externals/**/*')}}
|
||||||
- name: update hash
|
- name: update hash
|
||||||
if: ${{ ! github.event.pull_request.head.repo.fork && github.event_name == 'pull_request' && steps.compute-hash.outputs.NEED_UPDATE == true }}
|
if: ${{ ! github.event.pull_request.head.repo.fork && github.event_name == 'pull_request' && steps.compute-hash.outputs.NEED_UPDATE == 1 }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
ExternalHash=${{ steps.compute-hash.outputs.EXTERNAL_HASH }}
|
ExternalHash=${{ steps.compute-hash.outputs.EXTERNAL_HASH }}
|
||||||
@@ -102,7 +102,7 @@ jobs:
|
|||||||
echo "$DotNetRuntimeHash" > ./src/Misc/contentHash/dotnetRuntime/${{ matrix.runtime }}
|
echo "$DotNetRuntimeHash" > ./src/Misc/contentHash/dotnetRuntime/${{ matrix.runtime }}
|
||||||
fi
|
fi
|
||||||
- name: cache updated hashes
|
- name: cache updated hashes
|
||||||
if: ${{ ! github.event.pull_request.head.repo.fork && github.event_name == 'pull_request' && steps.compute-hash.outputs.NEED_UPDATE == true }}
|
if: ${{ ! github.event.pull_request.head.repo.fork && github.event_name == 'pull_request' && steps.compute-hash.outputs.NEED_UPDATE == 1 }}
|
||||||
uses: actions/cache/save@v3
|
uses: actions/cache/save@v3
|
||||||
with:
|
with:
|
||||||
enableCrossOsArchive: true
|
enableCrossOsArchive: true
|
||||||
@@ -111,11 +111,11 @@ jobs:
|
|||||||
./src/Misc/contentHash/dotnetRuntime/${{ matrix.runtime }}
|
./src/Misc/contentHash/dotnetRuntime/${{ matrix.runtime }}
|
||||||
key: compute-hashes-${{ matrix.runtime }}-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}
|
key: compute-hashes-${{ matrix.runtime }}-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}
|
||||||
- name: Create an warning annotation if computed hashes will automatically be updated
|
- name: Create an warning annotation if computed hashes will automatically be updated
|
||||||
if: ${{ ! github.event.pull_request.head.repo.fork && github.event_name == 'pull_request' && steps.compute-hash.outputs.NEED_UPDATE == true }}
|
if: ${{ ! github.event.pull_request.head.repo.fork && github.event_name == 'pull_request' && steps.compute-hash.outputs.NEED_UPDATE == 1 }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: echo "::warning ::Computed hashes do not match, we will automatically update these for you, you can safely ignore the errors on this job" && exit 1
|
run: echo "::warning ::Computed hashes do not match, we will automatically update these for you, you can safely ignore the errors on this job" && exit 1
|
||||||
- name: Create an error annotation if computed hashes need to be updated for a fork
|
- name: Create an error annotation if computed hashes need to be updated for a fork
|
||||||
if: ${{ github.event.pull_request.head.repo.fork && github.event_name == 'pull_request' && steps.compute-hash.outputs.NEED_UPDATE == true }}
|
if: ${{ github.event.pull_request.head.repo.fork && github.event_name == 'pull_request' && steps.compute-hash.outputs.NEED_UPDATE == 1 }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
ExternalHash=${{ steps.compute-hash.outputs.EXTERNAL_HASH }}
|
ExternalHash=${{ steps.compute-hash.outputs.EXTERNAL_HASH }}
|
||||||
@@ -138,7 +138,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
${{ matrix.devScript }} test
|
${{ matrix.devScript }} test
|
||||||
working-directory: src
|
working-directory: src
|
||||||
if: ${{ steps.compute-hash.outputs.NEED_UPDATE == false && matrix.runtime != 'linux-arm64' && matrix.runtime != 'linux-arm' && matrix.runtime != 'osx-arm64' && matrix.runtime != 'win-arm64' }}
|
if: ${{ steps.compute-hash.outputs.NEED_UPDATE == 0 && matrix.runtime != 'linux-arm64' && matrix.runtime != 'linux-arm' && matrix.runtime != 'osx-arm64' && matrix.runtime != 'win-arm64' }}
|
||||||
|
|
||||||
# Create runner package tar.gz/zip
|
# Create runner package tar.gz/zip
|
||||||
- name: Package Release
|
- name: Package Release
|
||||||
|
|||||||
Reference in New Issue
Block a user