Parcourir la source

CI: Replace `set-output` with environment file

https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Benoit Blanchon il y a 3 ans
Parent
commit
2a32803e9e
2 fichiers modifiés avec 8 ajouts et 8 suppressions
  1. 2 2
      .github/workflows/ci.yml
  2. 6 6
      .github/workflows/release.yml

+ 2 - 2
.github/workflows/ci.yml

@@ -482,7 +482,7 @@ jobs:
           INPUT=src/ArduinoJson.h
           OUTPUT=ArduinoJson-$VERSION.h
           extras/scripts/build-single-header.sh "$INPUT" "$OUTPUT"
-          echo ::set-output name=filename::${OUTPUT}
+          echo "filename=${OUTPUT}" >> $GITHUB_OUTPUT
       - name: Smoke test
         run: |
           g++ -x c++ - <<END
@@ -516,7 +516,7 @@ jobs:
           INPUT=src/ArduinoJson.hpp
           OUTPUT=ArduinoJson-$VERSION.hpp
           extras/scripts/build-single-header.sh "$INPUT" "$OUTPUT"
-          echo ::set-output name=filename::${OUTPUT}
+          echo "filename=${OUTPUT}" >> $GITHUB_OUTPUT
       - name: Smoke test
         run: |
           g++ -x c++ - <<END

+ 6 - 6
.github/workflows/release.yml

@@ -13,8 +13,8 @@ jobs:
       - name: Set variables
         id: init
         run: |
-          echo ::set-output name=tag::${GITHUB_REF#refs/tags/}
-          echo ::set-output name=version::${GITHUB_REF#refs/tags/v}
+          echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
+          echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
       - name: Checkout
         uses: actions/checkout@v2
       - name: Write release body
@@ -22,25 +22,25 @@ jobs:
         run: |
           FILENAME=RELEASE.md
           extras/scripts/get-release-body.sh ${{ steps.init.outputs.tag }} CHANGELOG.md | tee $FILENAME
-          echo ::set-output name=filename::$FILENAME
+          echo "filename=$FILENAME" >> $GITHUB_OUTPUT
       - name: Amalgamate ArduinoJson.h
         id: amalgamate_h
         run: |
           FILENAME=ArduinoJson-${{ steps.init.outputs.tag }}.h
           extras/scripts/build-single-header.sh src/ArduinoJson.h "$FILENAME"
-          echo ::set-output name=filename::$FILENAME
+          echo "filename=$FILENAME" >> $GITHUB_OUTPUT
       - name: Amalgamate ArduinoJson.hpp
         id: amalgamate_hpp
         run: |
           FILENAME=ArduinoJson-${{ steps.init.outputs.tag }}.hpp
           extras/scripts/build-single-header.sh src/ArduinoJson.hpp "$FILENAME"
-          echo ::set-output name=filename::$FILENAME
+          echo "filename=$FILENAME" >> $GITHUB_OUTPUT
       - name: Create Arduino package
         id: arduino
         run: |
           FILENAME=ArduinoJson-${{ steps.init.outputs.tag }}.zip
           extras/scripts/build-arduino-package.sh . "$FILENAME"
-          echo ::set-output name=filename::$FILENAME
+          echo "filename=$FILENAME" >> $GITHUB_OUTPUT
       - name: Create release
         uses: ncipollo/release-action@v1
         with: