Skip to content

Commit

Permalink
Use GITHUB_OUTPUT instead of GITHUB_ENV
Browse files Browse the repository at this point in the history
For values that are not used outside of the workflow syntax itself.
That is, to avoid pointlessly polluting the OS environment.
  • Loading branch information
pcolby committed Dec 16, 2023
1 parent 20a3192 commit 895621a
Showing 1 changed file with 21 additions and 17 deletions.
38 changes: 21 additions & 17 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@ jobs:
'https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage'
chmod a+x /home/runner/.local/bin/linuxdeploy{,-plugin-{appimage,qt}}-x86_64.AppImage
- name: Build
id: build
env:
CC: ${{ matrix.env.cc }}
CXX: ${{ matrix.env.cxx }}
PROJECT_BUILD_ID: ${{ github.run_number }}.linux.x86-64.${{ matrix.env.cc }}${{ matrix.env.coverage && '-cov' || '' }}
run: |
cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_COVERAGE=${{ matrix.env.coverage }} -S "$GITHUB_WORKSPACE" -B "$RUNNER_TEMP"
echo "dokitVersion=$(cat "$RUNNER_TEMP/version.txt")" >> $GITHUB_ENV
echo "dokitVersion=$(cat "$RUNNER_TEMP/version.txt")" | tee -a "$GITHUB_OUTPUT"
cmake --build "$RUNNER_TEMP"
"$RUNNER_TEMP/src/cli/dokit" --version
- name: Test
Expand All @@ -47,7 +48,7 @@ jobs:
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: test-results-${{ env.dokitVersion }}
name: test-results-${{ steps.build.outputs.dokitVersion }}
path: |
${{ runner.temp }}/coverage.info
${{ runner.temp }}/removeHtmlDates.sh
Expand All @@ -71,15 +72,15 @@ jobs:
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dokit-${{ env.dokitVersion }}
name: dokit-${{ steps.build.outputs.dokitVersion }}
path: |
${{ runner.temp }}/src/lib/libQtPokit.so
${{ runner.temp }}/src/cli/dokit
if-no-files-found: error
- name: Upload AppImage
uses: actions/upload-artifact@v4
with:
name: dokit-${{ env.dokitVersion }}.AppImage
name: dokit-${{ steps.build.outputs.dokitVersion }}.AppImage
path: ${{ runner.temp }}/dokit-${{ env.dokitVersion }}.AppImage
if-no-files-found: error

Expand Down Expand Up @@ -114,13 +115,14 @@ jobs:
'https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage'
chmod a+x /home/runner/.local/bin/linuxdeploy{,-plugin-{appimage,qt}}-x86_64.AppImage
- name: Build
id: build
env:
CC: ${{ matrix.env.cc }}
CXX: ${{ matrix.env.cxx }}
PROJECT_BUILD_ID: ${{ github.run_number }}.linux.x86-64.${{ matrix.env.cc }}${{ matrix.env.coverage && '-cov' || '' }}.qt-${{ matrix.qt }}
run: |
cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_COVERAGE=${{ matrix.env.coverage }} -S "$GITHUB_WORKSPACE" -B "$RUNNER_TEMP"
echo "dokitVersion=$(cat "$RUNNER_TEMP/version.txt")" >> $GITHUB_ENV
echo "dokitVersion=$(cat "$RUNNER_TEMP/version.txt")" | tee -a "$GITHUB_OUTPUT"
cmake --build "$RUNNER_TEMP"
"$RUNNER_TEMP/src/cli/dokit" --version
- name: Test
Expand All @@ -131,7 +133,7 @@ jobs:
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: test-results-${{ env.dokitVersion }}
name: test-results-${{ steps.build.outputs.dokitVersion }}
path: |
${{ runner.temp }}/coverage.info
${{ runner.temp }}/removeHtmlDates.sh
Expand All @@ -155,16 +157,16 @@ jobs:
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dokit-${{ env.dokitVersion }}
name: dokit-${{ steps.build.outputs.dokitVersion }}
path: |
${{ runner.temp }}/src/lib/libQtPokit.so
${{ runner.temp }}/src/cli/dokit
if-no-files-found: error
- name: Upload AppImage
uses: actions/upload-artifact@v4
with:
name: dokit-${{ env.dokitVersion }}.AppImage
path: ${{ runner.temp }}/dokit-${{ env.dokitVersion }}.AppImage
name: dokit-${{ steps.build.outputs.dokitVersion }}.AppImage
path: ${{ runner.temp }}/dokit-${{ steps.build.outputs.dokitVersion }}.AppImage
if-no-files-found: error

mac:
Expand Down Expand Up @@ -198,6 +200,7 @@ jobs:
version: ${{ matrix.qt }}
modules: ${{ startsWith(matrix.qt, '6') && 'qtconnectivity' || '' }}
- name: Build
id: build
env:
CC: ${{ matrix.env.cc }}
CXX: ${{ matrix.env.cxx }}
Expand All @@ -208,7 +211,7 @@ jobs:
-D CODECOV_GCOV=${{ startsWith(matrix.env.cc, 'gcc') && '/usr/local/bin/gcov-12' || '/usr/bin/gcov'}} \
-D ENABLE_COVERAGE=${{ matrix.env.coverage }} \
-S "$GITHUB_WORKSPACE" -B "$RUNNER_TEMP"
echo "dokitVersion=$(cat "$RUNNER_TEMP/version.txt")" >> $GITHUB_ENV
echo "dokitVersion=$(cat "$RUNNER_TEMP/version.txt")" | tee -a "$GITHUB_OUTPUT"
cmake --build "$RUNNER_TEMP" -- VERBOSE=1
find "$RUNNER_TEMP" -name 'Info.plist'
find "$RUNNER_TEMP" -name 'Info.plist' -execdir cat '{}' \;
Expand All @@ -221,7 +224,7 @@ jobs:
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: test-results-${{ env.dokitVersion }}
name: test-results-${{ steps.build.outputs.dokitVersion }}
path: |
${{ runner.temp }}/coverage.info
${{ runner.temp }}/removeHtmlDates.sh
Expand All @@ -245,7 +248,7 @@ jobs:
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: dokit-${{ env.dokitVersion }}
name: dokit-${{ steps.build.outputs.dokitVersion }}
path: ${{ runner.temp }}/src/cli/*.app
if-no-files-found: error

Expand Down Expand Up @@ -349,9 +352,10 @@ jobs:
if exist "%GITHUB_WORKSPACE%\..\Qt\Tools\mingw1120_64" set "PATH=%GITHUB_WORKSPACE%\..\Qt\Tools\mingw1120_64\bin\;%PATH%"
cmake -D CMAKE_BUILD_TYPE=Release -D QT_HOST_PATH=%qtHostPath% -G "${{ matrix.generator }}" -S "%GITHUB_WORKSPACE%" -B "%RUNNER_TEMP%"
cmake --build "%RUNNER_TEMP%"
- name: Setup dokitVersion env variable
- name: Capture build-output variables
id: post-build
shell: bash
run: echo "dokitVersion=$(cat "$RUNNER_TEMP/version.txt")" >> $GITHUB_ENV
run: echo "dokitVersion=$(cat "$RUNNER_TEMP/version.txt")" | tee -a "$GITHUB_OUTPUT"
- name: Install DLL for tests
run: |
copy /v /b src\lib\${{ matrix.dll }} /b test\unit\cli
Expand All @@ -364,7 +368,7 @@ jobs:
if: matrix.arch != 'arm64'
uses: actions/upload-artifact@v4
with:
name: test-results-${{ env.dokitVersion }}
name: test-results-${{ steps.post-build.outputs.dokitVersion }}
path: ${{ runner.temp }}/test/**/*.tap
if-no-files-found: ignore
- name: Make portable
Expand All @@ -384,7 +388,7 @@ jobs:
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: dokit-${{ env.dokitVersion }}
name: dokit-${{ steps.post-build.outputs.dokitVersion }}
path: |
${{ runner.temp }}/src/lib/${{ matrix.dll }}
${{ runner.temp }}/src/cli/dokit.exe
Expand All @@ -393,7 +397,7 @@ jobs:
if: matrix.arch != 'arm64'
uses: actions/upload-artifact@v4
with:
name: dokit-${{ env.dokitVersion }}.portable
name: dokit-${{ steps.post-build.outputs.dokitVersion }}.portable
path: ${{ runner.temp }}/portable
if-no-files-found: error

Expand Down

0 comments on commit 895621a

Please sign in to comment.