From 492f3734f81af53f054f06ed18d7f1a4499dad23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Fri, 3 May 2024 13:17:57 +0100 Subject: [PATCH] chore: update release actions Unmaintained actions, actions/create-release and -/upload-release-asset, were replaced with softprops/action-gh-release that combines the functionality of both. --- .github/workflows/ci.yml | 38 +++++++++++++------------------------- 1 file changed, 13 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9a390b3..2243b23 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -41,33 +43,19 @@ 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 + - name: Publish packages to PyPI + if: github.ref == 'refs/heads/master' env: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}