public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/vendors/microsoft/heads/main)] Use environment files instead of set-output command
@ 2023-04-27 23:38 Eugene Rozenfeld
  0 siblings, 0 replies; 2+ messages in thread
From: Eugene Rozenfeld @ 2023-04-27 23:38 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:a63acbd79bbfc484995c767ae56865cc1b3fd0d5

commit a63acbd79bbfc484995c767ae56865cc1b3fd0d5
Author: Eugene Rozenfeld <erozen@microsoft.com>
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: |

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [gcc(refs/vendors/microsoft/heads/main)] Use environment files instead of set-output command
@ 2023-05-02 23:18 Eugene Rozenfeld
  0 siblings, 0 replies; 2+ messages in thread
From: Eugene Rozenfeld @ 2023-05-02 23:18 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:4ba2cfc9c66a606520593814752db73f06c0e2ec

commit 4ba2cfc9c66a606520593814752db73f06c0e2ec
Author: Eugene Rozenfeld <erozen@microsoft.com>
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/common.py                     |  6 +++++-
 .github/scripts/config.py                     | 11 +++++++++--
 .github/scripts/gccWorkflow.py                |  6 +++++-
 .github/workflows/update-main.yaml            |  4 ++--
 .github/workflows/update-mirror-branches.yaml |  2 +-
 5 files changed, 22 insertions(+), 7 deletions(-)

diff --git a/.github/scripts/common.py b/.github/scripts/common.py
index 58de82132d9..1cee9c2ecbd 100755
--- a/.github/scripts/common.py
+++ b/.github/scripts/common.py
@@ -25,6 +25,7 @@ import logging
 import subprocess
 import requests
 import time
+import os
 
 # Exception class to raise when a basic workflow error happens
 class WorkflowError(Exception):
@@ -50,7 +51,10 @@ def GetandPrintCurrentSHA():
     res = subprocess.run('git rev-parse HEAD', shell=True, check=False, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
 
     # Output for Github to pick up output for future jobs
-    print("::set-output name=currentSHA::" + str(res.stdout, 'utf-8'))
+    name = 'currentSHA'
+    value = str(res.stdout, 'utf-8')
+    with open(os.environ['GITHUB_OUTPUT'], 'a') as fh:
+        print(f'{name}={value}', file=fh)
 
 def SendGetRestCmd(restCmd, restArgs, restHeader):
     logger = GetLogger()
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 636d44ce9c7..82cc94a82cc 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: |

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-05-02 23:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-27 23:38 [gcc(refs/vendors/microsoft/heads/main)] Use environment files instead of set-output command Eugene Rozenfeld
2023-05-02 23:18 Eugene Rozenfeld

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).