Skip to content

Commit

Permalink
[GitHub Actions] Replace set-output with environment file
Browse files Browse the repository at this point in the history
  • Loading branch information
past-due committed Oct 13, 2022
1 parent 87a0a16 commit c8e86ad
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 43 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/CI_flatpak.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ jobs:
fi
echo "WZ_OUTPUT_NAME_SUFFIX=${WZ_OUTPUT_NAME_SUFFIX}"
echo "WZ_OUTPUT_NAME_SUFFIX=${WZ_OUTPUT_NAME_SUFFIX}" >> $GITHUB_ENV
echo "::set-output name=WZ_OUTPUT_NAME_SUFFIX::${WZ_OUTPUT_NAME_SUFFIX}"
echo "WZ_OUTPUT_NAME_SUFFIX=${WZ_OUTPUT_NAME_SUFFIX}" >> $GITHUB_OUTPUT
echo "WZ_OUTPUT_FLATPAK_BUNDLE_SUFFIX=${WZ_OUTPUT_FLATPAK_BUNDLE_SUFFIX}"
echo "::set-output name=WZ_OUTPUT_FLATPAK_BUNDLE_SUFFIX::${WZ_OUTPUT_FLATPAK_BUNDLE_SUFFIX}"
echo "WZ_OUTPUT_FLATPAK_BUNDLE_SUFFIX=${WZ_OUTPUT_FLATPAK_BUNDLE_SUFFIX}" >> $GITHUB_OUTPUT
echo "WZ_NAME_SUFFIX=${WZ_NAME_SUFFIX}" >> $GITHUB_ENV
WZ_DISTRIBUTOR="UNKNOWN"
Expand Down Expand Up @@ -144,26 +144,26 @@ jobs:
SOURCE_TAG_IS_PRERELEASE="false"
fi
echo "::set-output name=publish-to-flathub::true"
echo "::set-output name=SOURCE_TAG_IS_PRERELEASE::${SOURCE_TAG_IS_PRERELEASE}"
echo "publish-to-flathub=true" >> $GITHUB_OUTPUT
echo "SOURCE_TAG_IS_PRERELEASE=${SOURCE_TAG_IS_PRERELEASE}" >> $GITHUB_OUTPUT
else
# Verify the "branch" doesn't equal "stable" or "beta" (which are reserved for tag builds)
# Otherwise reset it to default ("master")
if [[ "$WZ_FLATPAK_BRANCH" =~ ^(stable|beta)$ ]]; then
echo "NOTE: Invalid default branch specified for non-release / tag build ($WZ_FLATPAK_BRANCH)... will override"
WZ_FLATPAK_BRANCH="master"
fi
echo "::set-output name=publish-to-flathub::false"
echo "::set-output name=SOURCE_TAG_IS_PRERELEASE::false"
echo "publish-to-flathub=false" >> $GITHUB_OUTPUT
echo "SOURCE_TAG_IS_PRERELEASE=false" >> $GITHUB_OUTPUT
fi
echo "WZ_FLATPAK_BRANCH=${WZ_FLATPAK_BRANCH}"
echo "::set-output name=WZ_FLATPAK_BRANCH::${WZ_FLATPAK_BRANCH}"
echo "WZ_FLATPAK_BRANCH=${WZ_FLATPAK_BRANCH}" >> $GITHUB_OUTPUT
WZ_FLATPAK_APPID="net.wz2100.wz2100${WZ_OUTPUT_NAME_SUFFIX}"
echo "WZ_FLATPAK_APPID=${WZ_FLATPAK_APPID}" >> $GITHUB_ENV
WZ_FLATPAK_BUNDLE="warzone2100${WZ_OUTPUT_FLATPAK_BUNDLE_SUFFIX}_linux_${WZ_TARGET_ARCH}.flatpak"
echo "WZ_FLATPAK_BUNDLE=${WZ_FLATPAK_BUNDLE}" >> $GITHUB_ENV
echo "::set-output name=WZ_FLATPAK_BUNDLE::${WZ_FLATPAK_BUNDLE}"
echo "WZ_FLATPAK_BUNDLE=${WZ_FLATPAK_BUNDLE}" >> $GITHUB_OUTPUT
WZ_FLATPAK_MIRROR_SCREENSHOTS_URL="https://dl.flathub.org/repo/screenshots"
echo "WZ_FLATPAK_MIRROR_SCREENSHOTS_URL=${WZ_FLATPAK_MIRROR_SCREENSHOTS_URL}" >> $GITHUB_ENV
- name: Generate Flatpak manifest
Expand Down Expand Up @@ -206,7 +206,7 @@ jobs:
run: |
. src/.ci/flatpak/build.sh
echo "WZ_FLATPAK_LOCAL_REPO_NAME=${WZ_FLATPAK_LOCAL_REPO_NAME}"
echo "::set-output name=WZ_FLATPAK_LOCAL_REPO_NAME::${WZ_FLATPAK_LOCAL_REPO_NAME}"
echo "WZ_FLATPAK_LOCAL_REPO_NAME=${WZ_FLATPAK_LOCAL_REPO_NAME}" >> $GITHUB_OUTPUT
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
Expand Down Expand Up @@ -253,7 +253,7 @@ jobs:
run: |
. src/.ci/flatpak/build.sh
echo "WZ_FLATPAK_LOCAL_REPO_NAME=${WZ_FLATPAK_LOCAL_REPO_NAME}"
echo "::set-output name=WZ_FLATPAK_LOCAL_REPO_NAME::${WZ_FLATPAK_LOCAL_REPO_NAME}"
echo "WZ_FLATPAK_LOCAL_REPO_NAME=${WZ_FLATPAK_LOCAL_REPO_NAME}" >> $GITHUB_OUTPUT
upload-debug-symbols:
strategy:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/CI_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ jobs:
OUTPUTDIR="wz-macOS"
ZIPFILE="./dl-archive/warzone2100_macOS_universal_novideos.zip"
unzip -o "${ZIPFILE}" -d "${OUTPUTDIR}" && rm "${ZIPFILE}"
echo "::set-output name=ARCHIVEDIR::${OUTPUTDIR}"
echo "ARCHIVEDIR=${OUTPUTDIR}" >> $GITHUB_OUTPUT
- name: 'Upload debug symbols'
env:
SENTRY_AUTH_TOKEN: '${{ secrets.SENTRY_AUTH_TOKEN }}'
Expand Down
36 changes: 18 additions & 18 deletions .github/workflows/CI_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ jobs:
echo "Asciidoctor.bat: ${AsciidoctorBat}"
$AsciidoctorBatPath = Split-Path -Path "${AsciidoctorBat}"
echo "Asciidoctor.bat path: ${AsciidoctorBatPath}"
echo "::set-output name=ASCIIDOCTOR_PATH::${AsciidoctorBatPath}"
echo "ASCIIDOCTOR_PATH=${AsciidoctorBatPath}" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
- name: Install NSIS
run: choco install nsis -y
- name: Generate Settings for Run [${{ matrix.compiler }}:${{ matrix.architecture }}]
Expand Down Expand Up @@ -237,29 +237,29 @@ jobs:
$WZ_REPO_PATH = "${{ github.workspace }}\src"
# Export everything important to environment variables (for future steps)
echo "::set-output name=WZ_USING_MINGW::${WZ_USING_MINGW}"
echo "::set-output name=WZ_MINGW_PKG_PREFIX::${WZ_MINGW_PKG_PREFIX}"
echo "::set-output name=WZ_ASM_MASM_COMPILER::${WZ_ASM_MASM_COMPILER}"
echo "::set-output name=WZ_FULL_POWERSHELL_PATH::${WZ_FULL_POWERSHELL_PATH}"
echo "::set-output name=WZ_FULL_GIT_PATH::${WZ_FULL_GIT_PATH}"
echo "::set-output name=WZ_FULL_CMAKE_PATH::${WZ_FULL_CMAKE_PATH}"
echo "::set-output name=WZ_REPO_PATH::${WZ_REPO_PATH}"
echo "::set-output name=WZ_ENABLE_SENTRY::${WZ_ENABLE_SENTRY}"
echo "WZ_USING_MINGW=${WZ_USING_MINGW}" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
echo "WZ_MINGW_PKG_PREFIX=${WZ_MINGW_PKG_PREFIX}" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
echo "WZ_ASM_MASM_COMPILER=${WZ_ASM_MASM_COMPILER}" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
echo "WZ_FULL_POWERSHELL_PATH=${WZ_FULL_POWERSHELL_PATH}" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
echo "WZ_FULL_GIT_PATH=${WZ_FULL_GIT_PATH}" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
echo "WZ_FULL_CMAKE_PATH=${WZ_FULL_CMAKE_PATH}" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
echo "WZ_REPO_PATH=${WZ_REPO_PATH}" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
echo "WZ_ENABLE_SENTRY=${WZ_ENABLE_SENTRY}" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
echo "WZ_REPO_PATH=${WZ_REPO_PATH}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "VCPKG_DEFAULT_TRIPLET=${VCPKG_DEFAULT_TRIPLET}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "VCPKG_DEFAULT_HOST_TRIPLET=${VCPKG_DEFAULT_HOST_TRIPLET}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "WZ_VC_TARGET_PLATFORMNAME=${WZ_VC_TARGET_PLATFORMNAME}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "::set-output name=WZ_BUILD_DESC::${WZ_BUILD_DESC}"
echo "WZ_BUILD_DESC=${WZ_BUILD_DESC}" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
echo "WZ_BUILD_DESC=${WZ_BUILD_DESC}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "WZ_VC_GENERATOR=${WZ_VC_GENERATOR}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
#echo "WZ_VC_TOOLCHAIN=${WZ_VC_TOOLCHAIN}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "WZ_VISUAL_STUDIO_INSTALL_PATH=${WZ_VISUAL_STUDIO_INSTALL_PATH}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "::set-output name=WZ_VISUAL_STUDIO_INSTALL_VERSION::${WZ_VISUAL_STUDIO_INSTALL_VERSION}"
echo "WZ_VISUAL_STUDIO_INSTALL_VERSION=${WZ_VISUAL_STUDIO_INSTALL_VERSION}" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
echo "VCPKG_VISUAL_STUDIO_PATH=${VCPKG_VISUAL_STUDIO_PATH}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "WZ_DISTRIBUTOR=${WZ_DISTRIBUTOR}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "::set-output name=VCPKG_BINARYCACHE_DIR::${VCPKG_BINARYCACHE_DIR}"
echo "VCPKG_BINARYCACHE_DIR=${VCPKG_BINARYCACHE_DIR}" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
echo "VCPKG_BINARY_SOURCES=${VCPKG_BINARY_SOURCES}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "::set-output name=VCPKG_BINARY_SOURCES::${VCPKG_BINARY_SOURCES}"
echo "VCPKG_BINARY_SOURCES=${VCPKG_BINARY_SOURCES}" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
#####################################################
- name: 'Download & Install Vulkan SDK'
run: |
Expand Down Expand Up @@ -350,7 +350,7 @@ jobs:
Expand-Archive -LiteralPath "${NINJA_DL_PATH}" -DestinationPath "${NINJA_INSTALL_PATH}"
# Export the NINJA executable path
echo "::set-output name=NINJA_INSTALL_PATH::${NINJA_INSTALL_PATH}"
echo "NINJA_INSTALL_PATH=${NINJA_INSTALL_PATH}" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
echo "NINJA_INSTALL_PATH=${NINJA_INSTALL_PATH}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Setup LLVM-MINGW
if: success() && (steps.settings.outputs.WZ_USING_MINGW == 'true')
Expand Down Expand Up @@ -385,7 +385,7 @@ jobs:
# Export the LLVM-mingw install path
$LLVM_MINGW_INSTALL_PATH = "${LLVM_MINGW_INSTALL_PATH}\${LLVM_MINGW_PKG}"
echo "::set-output name=LLVM_MINGW_INSTALL_PATH::${LLVM_MINGW_INSTALL_PATH}"
echo "LLVM_MINGW_INSTALL_PATH=${LLVM_MINGW_INSTALL_PATH}" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
echo "LLVM_MINGW_INSTALL_PATH=${LLVM_MINGW_INSTALL_PATH}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
# Prepend bin path to the system PATH
Expand All @@ -412,9 +412,9 @@ jobs:
$WZ_MINGW_ENV_PATH = "${env:LLVM_MINGW_INSTALL_PATH}\bin;${env:WZ_FULL_GIT_PATH};${POWERSHELL_FOLDER};C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;${env:NINJA_INSTALL_PATH};${env:ASCIIDOCTOR_PATH}"
echo "WZ_MINGW_ENV_PATH=\"${WZ_MINGW_ENV_PATH}\""
echo "WZ_MINGW_ENV_PATH=${WZ_MINGW_ENV_PATH}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "::set-output name=WZ_MINGW_ENV_PATH::${WZ_MINGW_ENV_PATH}"
echo "WZ_MINGW_ENV_PATH=${WZ_MINGW_ENV_PATH}" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
echo "WZ_MINGW_DIST_PATH=${WZ_MINGW_DIST_PATH}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "::set-output name=WZ_MINGW_DIST_PATH::${WZ_MINGW_DIST_PATH}"
echo "WZ_MINGW_DIST_PATH=${WZ_MINGW_DIST_PATH}" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
- name: Cache vcpkg dependencies
id: vcpkg-cache
if: success() && !(github.event_name == 'workflow_run' && github.event.workflow_run.name == 'Draft Tag Release')
Expand Down Expand Up @@ -715,7 +715,7 @@ jobs:
echo "Removing breakpad .sym"
rm "${BREAKPAD_SYM}"
fi
echo "::set-output name=ARCHIVEDIR::${OUTPUTDIR}"
echo "ARCHIVEDIR=${OUTPUTDIR}" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
- name: Download Source Bundle
continue-on-error: true
uses: actions/download-artifact@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/draft_tag_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ jobs:
SOURCE_TAG_IS_PRERELEASE="false"
fi
echo "::set-output name=SOURCE_TAG::${SOURCE_TAG}"
echo "::set-output name=SOURCE_TAG_IS_PRERELEASE::${SOURCE_TAG_IS_PRERELEASE}"
echo "SOURCE_TAG=${SOURCE_TAG}" >> $GITHUB_OUTPUT
echo "SOURCE_TAG_IS_PRERELEASE=${SOURCE_TAG_IS_PRERELEASE}" >> $GITHUB_OUTPUT
- name: Create Draft Release
run: |
ADDITIONAL_GH_OPTIONS=""
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/generate_snap_stable_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
if [[ "${GH_EVENT_NAME}" == "release" ]] || [[ "${GH_EVENT_NAME}" == "workflow_dispatch" ]]; then
PUBLISH_CONFIG="true"
fi
echo "::set-output name=PUBLISH_CONFIG::${PUBLISH_CONFIG}"
echo "PUBLISH_CONFIG=${PUBLISH_CONFIG}" >> $GITHUB_OUTPUT
echo "PUBLISH_CONFIG=${PUBLISH_CONFIG}" >> $GITHUB_ENV
- name: Install Prereqs
run: |
Expand All @@ -59,9 +59,9 @@ jobs:
id: preparefolders
run: |
mkdir -p "$HOME/data/github_releases_info"
echo "::set-output name=RELEASES_DATA::$HOME/data/github_releases_info"
echo "RELEASES_DATA=$HOME/data/github_releases_info" >> $GITHUB_OUTPUT
mkdir -p "$HOME/temp/github_releases_info"
echo "::set-output name=RELEASES_TEMP::$HOME/temp/github_releases_info"
echo "RELEASES_TEMP=$HOME/temp/github_releases_info" >> $GITHUB_OUTPUT
mkdir -p "${{ github.workspace }}/diff"
- name: Fetch latest GitHub Release info
uses: past-due/fetch-release-info@master
Expand Down Expand Up @@ -139,12 +139,12 @@ jobs:
git config user.email "[email protected]"
git add -A
timestamp=$(date -u)
git commit -m "Snap stable build config for ${LATEST_GITHUB_RELEASE_TAG}" || { echo "::set-output name=PROCESS_DEPLOYMENT::false" && exit 0; }
echo "::set-output name=PROCESS_DEPLOYMENT::true"
git commit -m "Snap stable build config for ${LATEST_GITHUB_RELEASE_TAG}" || { echo "PROCESS_DEPLOYMENT=false" >> $GITHUB_OUTPUT && exit 0; }
echo "PROCESS_DEPLOYMENT=true" >> $GITHUB_OUTPUT
# Get the new commit's SHA
NEW_COMMIT_SHA=$(git rev-parse --verify HEAD)
echo "NEW_COMMIT_SHA=${NEW_COMMIT_SHA}"
echo "::set-output name=GH_SNAPSTABLEBUILD_COMMIT_SHA::${NEW_COMMIT_SHA}"
echo "GH_SNAPSTABLEBUILD_COMMIT_SHA=${NEW_COMMIT_SHA}" >> $GITHUB_OUTPUT
exit 0
- name: Snap build stable config (w/ most recent stable version)
id: build-stable
Expand Down Expand Up @@ -175,7 +175,7 @@ jobs:
run: |
git format-patch -k -1 --stdout "${GH_SNAPSTABLEBUILD_COMMIT_SHA}" > "${{ github.workspace }}/diff/snapstablebuild.diff"
DIFF_HASH="$(sha512sum "${{ github.workspace }}/diff/snapstablebuild.diff")"
echo "::set-output name=DIFF_HASH::${DIFF_HASH}"
echo "DIFF_HASH=${DIFF_HASH}" >> $GITHUB_OUTPUT
echo "snapstablebuild.diff (SHA512: ${DIFF_HASH}):"
cat "${{ github.workspace }}/diff/snapstablebuild.diff"
- name: Upload diff artifact
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/maintenance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ jobs:
git config user.name "github-actions[bot]"
git config user.email "<41898282+github-actions[bot]@users.noreply.github.com>"
git add -A
git commit -m "Update base translations" || { echo "::set-output name=PROCESS_PR::false" && exit 0; }
git commit -m "Update base translations" || { echo "PROCESS_PR=false" >> $GITHUB_OUTPUT && exit 0; }
echo "Pushing changes to update_base_translations branch"
git push -f origin master:update_base_translations
echo "::set-output name=PROCESS_PR::true"
echo "PROCESS_PR=true" >> $GITHUB_OUTPUT
- name: Create Pull Request to update base files (if needed)
if: success() && (github.repository == 'Warzone2100/warzone2100') && (steps.pushupdates.outputs.PROCESS_PR == 'true')
id: cpr
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/mirror_release_sourceforge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ jobs:
# Get information for this tagged release
tagged_release_id="${{ github.event.release.id }}"
echo "tagged_release_id=${tagged_release_id}"
echo "::set-output name=tagged_release_id::${tagged_release_id}"
echo "tagged_release_id=${tagged_release_id}" >> $GITHUB_OUTPUT
SF_FILE_PATH=""
if [ ! -z "${SF_BASE_PATH}" ]; then
SF_FILE_PATH="${SF_BASE_PATH}/"
fi
SF_FILE_PATH="${SF_FILE_PATH}${RELEASE_TAG}"
echo "SF_FILE_PATH=${SF_FILE_PATH}"
echo "::set-output name=SF_FILE_PATH::${SF_FILE_PATH}"
echo "SF_FILE_PATH=${SF_FILE_PATH}" >> $GITHUB_OUTPUT
# Prepare release_assets directory
mkdir -p "release_assets/${SF_FILE_PATH}"
Expand All @@ -86,7 +86,7 @@ jobs:
echo "Get Latest Release info for repo: ${GITHUB_REPOSITORY}"
latest_release_id="$(curl -H "Accept: application/vnd.github.v3.raw" -H "Authorization: token ${GITHUB_TOKEN}" -s "https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/latest" | jq '.id')"
echo "latest_release_id=${latest_release_id}"
echo "::set-output name=latest_release_id::${latest_release_id}"
echo "latest_release_id=${latest_release_id}" >> $GITHUB_OUTPUT
- name: Set up SourceForge known_hosts
run: |
mkdir -p ~/.ssh/
Expand Down

0 comments on commit c8e86ad

Please sign in to comment.