Skip to content

Commit

Permalink
Use environment rather than set-output commands to avoid GitHub dep…
Browse files Browse the repository at this point in the history
…recation
  • Loading branch information
kavanase authored Mar 13, 2024
1 parent f0dc5a6 commit 3fc226a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,31 +34,31 @@ jobs:
current_pip_version=$(pip index versions shakenbreak | grep LATEST | awk '{print $NF}')
current_repo_version=$(grep version setup.py | awk -F\" '{print $2}' | head -1)
if [ "$current_pip_version" != "$current_repo_version" ]; then
echo "::set-output name=version_changed::true"
echo "version_changed=true" >> $GITHUB_ENV
else
echo "::set-output name=version_changed::false"
echo "version_changed=false" >> $GITHUB_ENV
fi
- name: Build packages
if: steps.check_version.outputs.version_changed == 'true'
if: env.version_changed == 'true'
run: |
python setup.py sdist bdist_wheel
- name: Publish
if: steps.check_version.outputs.version_changed == 'true'
if: env.version_changed == 'true'
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.TWINE_PASSWORD }}

- name: Generate release info
if: steps.check_version.outputs.version_changed == 'true'
if: env.version_changed == 'true'
run: |
awk 'BEGIN {p = 0} {a = 0 }; /^v\d*.\d*.\d*./ { p += 1; a = 1}; p + a == 1 { print } ' CHANGELOG.rst | sed -e '1,1d' | sed -e '/./,$!d' -e :a -e '/^\n*$/{$d;N;ba' -e '}' > release_info.txt
echo "version=$(grep version setup.py | awk -F\" '{print $2}')" >> $GITHUB_ENV
- name: Release
if: steps.check_version.outputs.version_changed == 'true'
if: env.version_changed == 'true'
uses: actions/create-release@v1
id: create_release
env:
Expand Down

0 comments on commit 3fc226a

Please sign in to comment.