From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7840) id 6AA9F3858C1F; Thu, 27 Apr 2023 23:48:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6AA9F3858C1F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1682639283; bh=GVdVjy8FtERnwy7NFyEx6QVK121NX2+QgjhrB6YUW6s=; h=From:To:Subject:Date:From; b=Az04V3wx06eYXBhkd60GghmFgWXkY2nRdx7YMMlGLG9Cf6YaM5EUo0DP9JQVQw8/d 2S9+8emWapW8y2EAJfjf4oKkoJsxsnC1QXHFqLFawxhdsV8jxVgdNT+hrJifR0maOx bgjJ5jvqov9a/FM0pY/1dyI+2nX82f0+vpcCTk1w= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Eugene Rozenfeld To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/vendors/microsoft/heads/releases/gcc-11)] Use environment files instead of set-output command X-Act-Checkin: gcc X-Git-Author: Eugene Rozenfeld X-Git-Refname: refs/vendors/microsoft/heads/releases/gcc-11 X-Git-Oldrev: 4ce27dfe5e22c0d3379efe92a547b6a1b40aad67 X-Git-Newrev: 3dbb8efab00b951373364f3060790886944aadd6 Message-Id: <20230427234803.6AA9F3858C1F@sourceware.org> Date: Thu, 27 Apr 2023 23:48:03 +0000 (GMT) List-Id: https://gcc.gnu.org/g:3dbb8efab00b951373364f3060790886944aadd6 commit 3dbb8efab00b951373364f3060790886944aadd6 Author: Eugene Rozenfeld Date: Wed Apr 26 19:14:09 2023 -0700 Use environment files instead of set-output command set-output command has been deprecated. Diff: --- .github/scripts/config.py | 11 +++++++++-- .github/scripts/gccWorkflow.py | 6 +++++- .github/workflows/update-main.yaml | 4 ++-- .github/workflows/update-mirror-branches.yaml | 2 +- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.github/scripts/config.py b/.github/scripts/config.py index 709e340c4cc..53781ead4a7 100755 --- a/.github/scripts/config.py +++ b/.github/scripts/config.py @@ -26,6 +26,7 @@ import globals from common import * from downloadBuildArtifact import * import sys +import os # subclass JSONEncoder to convert the Config object into JSON class ConfigEncoder(JSONEncoder): @@ -73,7 +74,10 @@ class Config(object): configJson = json.dumps(newConfig, cls=ConfigEncoder) # Output for Github to pick up output for future steps - print("::set-output name=configJson::" + configJson) + name = 'configJson' + value = configJson + with open(os.environ['GITHUB_OUTPUT'], 'a') as fh: + print(f'{name}={value}', file=fh) # Set global config object globals.configObj = newConfig @@ -88,7 +92,10 @@ class Config(object): configJson = json.dumps(globals.configObj, cls=ConfigEncoder) # Output for Github to pick up output for future jobs - print("::set-output name=noSecretConfigJson::" + configJson) + name = 'noSecretConfigJson' + value = configJson + with open(os.environ['GITHUB_OUTPUT'], 'a') as fh: + print(f'{name}={value}', file=fh) @staticmethod def PrintNoSecretConfigJsonFromJson(configJson): diff --git a/.github/scripts/gccWorkflow.py b/.github/scripts/gccWorkflow.py index 411aac30434..585a99a140d 100755 --- a/.github/scripts/gccWorkflow.py +++ b/.github/scripts/gccWorkflow.py @@ -43,7 +43,11 @@ class GccWorkflow(object): "testSet" : ["check-target-libstdc++-v3", "check-gcc-c++", "check-gcc-c", "check-target-libgomp", "check-target-libitm", "check-target-libatomic"] } dictionaryJson = json.dumps(dictionary) - print("::set-output name=testSet::" + dictionaryJson) + + name = 'testSet' + value = dictionaryJson + with open(os.environ['GITHUB_OUTPUT'], 'a') as fh: + print(f'{name}={value}', file=fh) # Runs the configure script to set up gcc configuration environment prior to building and running tests # Creates the objdir directory as part of this process diff --git a/.github/workflows/update-main.yaml b/.github/workflows/update-main.yaml index 79fd829fa5c..fd9804d629d 100644 --- a/.github/workflows/update-main.yaml +++ b/.github/workflows/update-main.yaml @@ -263,11 +263,11 @@ jobs: - name: Get current date id: date - run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H-%M-%S')" + run: echo "date=$(date +'%Y-%m-%dT%H-%M-%S')" >> $GITHUB_OUTPUT - name: Set new branch name id: setBranchName - run: echo "::set-output name=newBranchName::${name}" + run: echo "newBranchName=${name}" >> $GITHUB_OUTPUT env: name: merge-master-${{ needs.gcc-master-build.outputs.masterSHA }}-${{ steps.date.outputs.date }} diff --git a/.github/workflows/update-mirror-branches.yaml b/.github/workflows/update-mirror-branches.yaml index cc7b56fb7f0..baba7ada092 100644 --- a/.github/workflows/update-mirror-branches.yaml +++ b/.github/workflows/update-mirror-branches.yaml @@ -79,7 +79,7 @@ jobs: - name: Get current date id: date - run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H-%M-%S')" + run: echo "date=$(date +'%Y-%m-%dT%H-%M-%S')" >> $GITHUB_OUTPUT - name: Push to branch in GitHub repo run: |