Skip to content

Commit

Permalink
chore: update release actions
Browse files Browse the repository at this point in the history
Unmaintained actions, actions/create-release and -/upload-release-asset,
were replaced with softprops/action-gh-release that combines the
functionality of both.
  • Loading branch information
biochimia committed May 3, 2024
1 parent 9f965b3 commit 0f2d0ac
Showing 1 changed file with 14 additions and 25 deletions.
39 changes: 14 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ jobs:
run: make test

publish:
if: github.ref == 'refs/heads/master'
if: github.ref == 'refs/heads/update-release-actions'
needs: build

runs-on: ubuntu-latest
permissions:
contents: write

steps:
- uses: actions/checkout@v4
Expand All @@ -41,33 +43,20 @@ jobs:
run: |
echo 'package version: ${{ steps.package.outputs.package_version }}'
echo 'git revision: ${{ steps.package.outputs.git_revision }}'
- id: github_release
name: Create GitHub release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: softprops/action-gh-release@v2
with:
name: Release v${{ steps.package.outputs.package_version }}
tag_name: v${{ steps.package.outputs.package_version }}
release_name: Release v${{ steps.package.outputs.package_version }}
- name: Publish source distribution to Github
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.github_release.outputs.upload_url }}
asset_path: dist/cfn-review-bot-${{ steps.package.outputs.package_version }}.tar.gz
asset_name: cfn-review-bot-${{ steps.package.outputs.package_version }}.tar.gz
asset_content_type: application/gzip
- name: Publish wheel to Github
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.github_release.outputs.upload_url }}
asset_path: dist/cfn_review_bot-${{ steps.package.outputs.package_version }}-py3-none-any.whl
asset_name: cfn_review_bot-${{ steps.package.outputs.package_version }}-py3-none-any.whl
asset_content_type: application/zip
prerelease: true
files: |
dist/cfn-review-bot-${{ steps.package.outputs.package_version }}.tar.gz
dist/cfn_review_bot-${{ steps.package.outputs.package_version }}-py3-none-any.whl
fail_on_unmatched_files: true
generate_release_notes: true

- name: Publish packages to PyPI
if: github.ref == 'refs/heads/master'
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
Expand Down

0 comments on commit 0f2d0ac

Please sign in to comment.