Skip to content

Commit

Permalink
Merge pull request #84 from ConorMacBride/upgrade-outputs
Browse files Browse the repository at this point in the history
Fix deprecated `set-output` command
  • Loading branch information
ConorMacBride authored Nov 4, 2022
2 parents 02fdb8c + 79b8767 commit feae8f5
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 10 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,17 +103,17 @@ jobs:
- run: python -m pip install PyYAML click
- run: echo $LOAD_BUILD_TARGETS_SCRIPT | base64 --decode > load_build_targets.py
env:
LOAD_BUILD_TARGETS_SCRIPT: aW1wb3J0IGpzb24KaW1wb3J0IG9zCgppbXBvcnQgY2xpY2sKaW1wb3J0IHlhbWwKCk1BQ0hJTkVfVFlQRSA9IHsKICAgICJsaW51eCI6ICJ1YnVudHUtbGF0ZXN0IiwKICAgICJtYWNvcyI6ICJtYWNvcy1sYXRlc3QiLAogICAgIndpbmRvd3MiOiAid2luZG93cy1sYXRlc3QiLAp9CgpDSUJXX0JVSUxEID0gb3MuZW52aXJvbi5nZXQoIkNJQldfQlVJTEQiLCAiKiIpCkNJQldfQVJDSFMgPSBvcy5lbnZpcm9uLmdldCgiQ0lCV19BUkNIUyIsICJhdXRvIikKCgpAY2xpY2suY29tbWFuZCgpCkBjbGljay5vcHRpb24oIi0tdGFyZ2V0cyIsIGRlZmF1bHQ9IiIpCmRlZiBsb2FkX2J1aWxkX3RhcmdldHModGFyZ2V0cyk6CiAgICAiIiJTY3JpcHQgdG8gbG9hZCBjaWJ1aWxkd2hlZWwgdGFyZ2V0cyBmb3IgR2l0SHViIEFjdGlvbnMgd29ya2Zsb3cuIiIiCiAgICAjIExvYWQgbGlzdCBvZiB0YXJnZXRzCiAgICB0YXJnZXRzID0geWFtbC5sb2FkKHRhcmdldHMsIExvYWRlcj15YW1sLkJhc2VMb2FkZXIpCiAgICBwcmludChqc29uLmR1bXBzKHRhcmdldHMsIGluZGVudD0yKSkKCiAgICAjI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H0KCgppZiBfX25hbWVfXyA9PSAiX19tYWluX18iOgogICAgbG9hZF9idWlsZF90YXJnZXRzKCkK
- id: set-outputs
run: python load_build_targets.py --targets "${{ inputs.targets }}"
shell: sh
- id: set-upload
run: |
if [ $UPLOAD_TO_PYPI == "true" ] || [ $UPLOAD_TAG == "true" ];
then
echo "::set-output name=upload_to_pypi::true"
echo "upload_to_pypi=true" >> $GITHUB_OUTPUT
else
echo "::set-output name=upload_to_pypi::false"
echo "upload_to_pypi=false" >> $GITHUB_OUTPUT
fi
env:
UPLOAD_TO_PYPI: ${{ inputs.upload_to_pypi }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish_pure_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ jobs:
run: |
if [ $UPLOAD_TO_PYPI == "true" ] || [ $UPLOAD_TAG == "true" ];
then
echo "::set-output name=upload_to_pypi::true"
echo "upload_to_pypi=true" >> $GITHUB_OUTPUT
else
echo "::set-output name=upload_to_pypi::false"
echo "upload_to_pypi=false" >> $GITHUB_OUTPUT
fi
env:
UPLOAD_TO_PYPI: ${{ inputs.upload_to_pypi }}
Expand Down
Loading

0 comments on commit feae8f5

Please sign in to comment.