chore(version): Bump version to 3.9.0 #20
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will upload a Python Package using Twine when a release is created | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries | |
# This workflow uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
name: Release new version | |
on: | |
push: | |
tags: | |
- 'v3.*' | |
- '!v3.*post*' | |
jobs: | |
build: | |
name: Build package | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version-file: "pyproject.toml" | |
- name: Install pip/build | |
run: | | |
python3 -m pip install --upgrade pip | |
python3 -m pip install build --user | |
- name: Build a binary wheel and a source tarball | |
run: python3 -m build | |
- name: Store the distribution packages | |
uses: actions/upload-artifact@v4 | |
with: | |
name: python-package-distributions-${{ github.ref_name }} | |
path: dist/ | |
github-release: | |
name: Release on GitHub | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write # IMPORTANT: mandatory for making GitHub Releases | |
needs: | |
- build | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: python-package-distributions-${{ github.ref_name }} | |
path: dist/ | |
- name: Create GitHub Release | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
run: >- | |
gh release create | |
'${{ github.ref_name }}' | |
dist/** | |
--repo '${{ github.repository }}' | |
--title '${{ github.ref_name }}' | |
--generate-notes | |
--latest | |
--verify-tag | |
publish-to-pypi: | |
name: Publish to PyPI | |
needs: | |
- build | |
runs-on: ubuntu-latest | |
environment: | |
name: pypi | |
url: https://pypi.org/p/instana/ | |
permissions: | |
id-token: write # IMPORTANT: mandatory for trusted publishing | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: python-package-distributions-${{ github.ref_name }} | |
path: dist/ | |
- name: Publish to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
notify-slack: | |
name: Notify on Slack | |
needs: | |
- github-release | |
- publish-to-pypi | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Fetch all history to access commit messages | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.13' | |
- name: Install dependencies | |
run: | | |
pip install httpx PyGithub | |
# Send notification using the safely set environment variables | |
- name: Send Slack notification | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GITHUB_RELEASE_TAG: ${{ github.ref_name }} | |
SLACK_TOKEN: ${{ secrets.RUPY_TRACER_RELEASES_TOKEN }} | |
SLACK_SERVICE: ${{ secrets.RUPY_TRACER_RELEASES_CHANNEL_ID }} | |
SLACK_TEAM: ${{ secrets.RUPY_TOWN_CRIER_SERVICE_ID }} | |
run: | | |
echo "New release published ${GITHUB_RELEASE_TAG}" | |
python .github/scripts/announce_release_on_slack.py | |