diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a0ee979..6e1bfaf 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -16,20 +16,24 @@ jobs: contents: write steps: - uses: actions/checkout@v3 + - name: Set up Python uses: actions/setup-python@v4 with: python-version: "3.x" + - name: Build source and wheel distributions run: | python -m pip install --upgrade build twine python -m build twine check --strict dist/* + - name: Publish distribution to PyPI id: release uses: pypa/gh-action-pypi-publish@v1.5.1 with: password: ${{ secrets.PYPI_TOKEN }} + - name: Create tag if: steps.release.outputs.exit_code == 0 id: tag_version @@ -38,6 +42,7 @@ jobs: github_token: ${{ secrets.TAGS_TOKEN }} custom_tag: ${{ github.event.inputs.Version }} tag_prefix: "" + - name: Create changelog for the release if: steps.release.outputs.exit_code == 0 uses: ncipollo/release-action@v1 @@ -45,3 +50,12 @@ jobs: tag: ${{ steps.tag_version.outputs.new_tag }} name: Release Version ${{ github.event.inputs.Version }} body: ${{ steps.tag_version.outputs.changelog }} + + - name: Send slack notification + id: slack + uses: slackapi/slack-github-action@v1.25.0 + with: + channel-id: 'C012YFE3D6D' + slack-message: "core-lib-python release has been triggered!" + env: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} diff --git a/.github/workflows/release-notification.yml b/.github/workflows/release-notification.yml deleted file mode 100644 index 4e80ea3..0000000 --- a/.github/workflows/release-notification.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Release Notification - -on: - release: - types: [released] - -jobs: - send-slack-notification: - runs-on: ubuntu-latest - timeout-minutes: 2 - steps: - - name: Send slack notification - id: slack - uses: slackapi/slack-github-action@v1.25.0 - with: - channel-id: 'C012YFE3D6D' - slack-message: "core-lib-python release has been triggered!" - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}