diff --git a/.github/workflows/pkg_release.yml b/.github/workflows/pkg_release.yml index 046dbf61..bd37c54c 100644 --- a/.github/workflows/pkg_release.yml +++ b/.github/workflows/pkg_release.yml @@ -80,3 +80,40 @@ jobs: 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 + \ No newline at end of file diff --git a/.github/workflows/py3140_build.yml b/.github/workflows/py3140_build.yml deleted file mode 100644 index 1cff4a73..00000000 --- a/.github/workflows/py3140_build.yml +++ /dev/null @@ -1,58 +0,0 @@ -# This workflow builds a container image on top of the Python 3.14.0 RC images -# with all dependencies already compiled and installed to be used in the tests -# CI pipelines. - -name: Build Instana python-sensor-test-py3.14.0 -on: - workflow_dispatch: # Manual trigger. - schedule: - - cron: '1 0 * * 1,3' # Every Monday and Wednesday at midnight and one. -env: - IMAGE_NAME: python-sensor-test-py3.14.0 - IMAGE_TAG: latest - CONTAINER_FILE: ./Dockerfile-py3140 - IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }} - REGISTRY_USER: ${{ github.actor }} - REGISTRY_PASSWORD: ${{ github.token }} -jobs: - build-and-push: - name: Build container image. - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - steps: - - uses: actions/checkout@v4 - - - name: Build image - id: build_image - uses: redhat-actions/buildah-build@v2 - with: - image: ${{ env.IMAGE_NAME }} - tags: ${{ env.IMAGE_TAG }} - containerfiles: ${{ env.CONTAINER_FILE }} - - - name: Echo Outputs - run: | - echo "Image: ${{ steps.build_image.outputs.image }}" - echo "Tags: ${{ steps.build_image.outputs.tags }}" - echo "Tagged Image: ${{ steps.build_image.outputs.image-with-tag }}" - - - name: Check images created - run: buildah images | grep '${{ env.IMAGE_NAME }}' - - # Push the image to GHCR (Image Registry) - - name: Push To GHCR - uses: redhat-actions/push-to-registry@v2 - id: push-to-ghcr - with: - image: ${{ steps.build_image.outputs.image }} - tags: ${{ steps.build_image.outputs.tags }} - registry: ${{ env.IMAGE_REGISTRY }} - username: ${{ env.REGISTRY_USER }} - password: ${{ env.REGISTRY_PASSWORD }} - extra-args: | - --disable-content-trust - - - name: Print image URL - run: echo "Image pushed to ${{ steps.push-to-ghcr.outputs.registry-paths }}" diff --git a/.github/workflows/release-notification-on-slack.yml b/.github/workflows/release-notification-on-slack.yml deleted file mode 100644 index 3952dc8e..00000000 --- a/.github/workflows/release-notification-on-slack.yml +++ /dev/null @@ -1,65 +0,0 @@ -name: Slack Post -on: - workflow_dispatch: # Manual trigger - inputs: - github_ref: - description: 'Manually provided value for GITHUB_RELEASE_TAG of a release' - required: true - type: string - - # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release - release: - types: [published, released] -jobs: - notify-slack: - runs-on: ubuntu-latest - - 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 - - # Set environment variables safely - - name: Set event name - id: set-event-name - env: - EVENT_NAME: ${{ github.event_name }} - run: echo "EVENT_NAME=$EVENT_NAME" >> $GITHUB_ENV - - # Handle workflow_dispatch event - - name: Set GitHub ref for workflow dispatch - if: ${{ github.event_name == 'workflow_dispatch' }} - env: - INPUT_REF: ${{ inputs.github_ref }} - run: echo "GITHUB_RELEASE_TAG=$INPUT_REF" >> $GITHUB_ENV - - # Handle release event - - name: Set GitHub ref for release event - if: ${{ github.event_name != 'workflow_dispatch' }} - env: - GH_REF: ${{ github.ref }} - run: | - REF_NAME=$(basename "$GH_REF") - echo "GITHUB_RELEASE_TAG=$REF_NAME" >> $GITHUB_ENV - - # Send notification using the safely set environment variables - - name: Send Slack notification - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - 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 - \ No newline at end of file