Skip to content

Commit

Permalink
Test image shipping to GCP
Browse files Browse the repository at this point in the history
  • Loading branch information
rasa-aadlv authored Feb 3, 2025
1 parent 3aea02a commit 57c2191
Showing 1 changed file with 107 additions and 86 deletions.
193 changes: 107 additions & 86 deletions .github/workflows/release-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,97 +53,118 @@ jobs:
- name: Login to Docker Hub Registry 🔢
run: echo ${{ secrets.DOCKER_HUB_PASSWORD }} | docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin || true

- name: Build and Push Docker image 📦
# Authenticate with Gcloud.
- name: Authenticate with gcloud for release registry 🎫
id: 'auth-release'
uses: 'google-github-actions/auth@ef5d53e30bbcd8d0836f4288f5e50ff3e086997d'
with:
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
service_account: '${{ secrets.RASA_SDK_RELEASE_ACCOUNT_NAME }}'

# Authenticate with artifact registry where the images are stored.
- name: Authenticate docker for release registry 🎫
run: gcloud auth configure-docker europe-west3-docker.pkg.dev

# - name: Build and Push Docker image to the DockerHub 📦
# run: |
# IMAGE_NAME=rasa/rasa-sdk
# IMAGE_TAG=$IMAGE_TAG
# make build-and-push-multi-platform-docker
# env:
# IMAGE_TAG: ${{ needs.define-release-version.outputs.version }}

- name: Build and Push Docker image to the GCP 📦
run: |
IMAGE_NAME=rasa/rasa-sdk
IMAGE_TAG=$IMAGE_TAG
IMAGE_TAG=$RELEASE_REGISTRY_SDK
make build-and-push-multi-platform-docker
env:
IMAGE_TAG: ${{ needs.define-release-version.outputs.version }}
RELEASE_REGISTRY_SDK: "europe-west3-docker.pkg.dev/rasa-releases/rasa-sdk"

release-artifacts-pypi:
name: Release Artifacts PyPI
runs-on: ubuntu-24.04
needs: define-release-version
# release-artifacts-pypi:
# name: Release Artifacts PyPI
# runs-on: ubuntu-24.04
# needs: define-release-version

steps:
- name: Checkout git repository 🕝
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: ${{ needs.define-release-version.outputs.version }}

- name: Set up Python 3.10 🐍
uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435
with:
python-version: '3.10'

- name: Read Poetry Version 🔢
run: |
echo "POETRY_VERSION=$(scripts/poetry-version.sh)" >> $GITHUB_ENV
shell: bash

- name: Install poetry 🦄
uses: Gr1N/setup-poetry@15821dc8a61bc630db542ae4baf6a7c19a994844
with:
poetry-version: ${{ env.POETRY_VERSION }}

- name: Build ⚒️ Distributions
run: poetry build

- name: Publish to PyPI 📦
uses: pypa/gh-action-pypi-publish@bea5cda687c2b79989126d589ef4411bedce0195
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
skip_existing: true

release-atifacts-publish-release:
name: Release Artifacts Publish Release
runs-on: ubuntu-24.04
needs: [define-release-version, release-artifacts-docker, release-artifacts-pypi]

steps:
- name: Check out code
if: success()
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: ${{ needs.define-release-version.outputs.version }}
# steps:
# - name: Checkout git repository 🕝
# uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
# with:
# ref: ${{ needs.define-release-version.outputs.version }}

# - name: Set up Python 3.10 🐍
# uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435
# with:
# python-version: '3.10'

# - name: Read Poetry Version 🔢
# run: |
# echo "POETRY_VERSION=$(scripts/poetry-version.sh)" >> $GITHUB_ENV
# shell: bash

# - name: Install poetry 🦄
# uses: Gr1N/setup-poetry@15821dc8a61bc630db542ae4baf6a7c19a994844
# with:
# poetry-version: ${{ env.POETRY_VERSION }}

# - name: Build ⚒️ Distributions
# run: poetry build

# - name: Publish to PyPI 📦
# uses: pypa/gh-action-pypi-publish@bea5cda687c2b79989126d589ef4411bedce0195
# with:
# user: __token__
# password: ${{ secrets.PYPI_TOKEN }}
# skip_existing: true

# release-atifacts-publish-release:
# name: Release Artifacts Publish Release
# runs-on: ubuntu-24.04
# needs: [define-release-version, release-artifacts-docker, release-artifacts-pypi]

# steps:
# - name: Check out code
# if: success()
# uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
# with:
# ref: ${{ needs.define-release-version.outputs.version }}

- name: Publish Release Notes 🗞
if: success()
env:
GITHUB_TAG: ${{ needs.define-release-version.outputs.version }}
GITHUB_REPO_SLUG: ${{ github.repository }}
GITHUB_TOKEN: ${{ secrets.RASASDK_GITHUB_TOKEN }}
run: |
GITHUB_TAG=$GITHUB_TAG
pip install -U github3.py pep440-version-utils
python3 scripts/publish_gh_release_notes.py
release-artifact-slack-notifications:
name: Release Analytics Artifact Slack Notifications
runs-on: ubuntu-24.04
needs: [define-release-version, release-artifacts-docker, release-artifacts-pypi, release-atifacts-publish-release]

if: always() # Ensures this job runs regardless of the result of previous jobs

steps:
- name: Notify Slack of successful release 💬
if: ${{ needs.release-artifacts-docker.result == 'success' && needs.release-artifacts-pypi.result == 'success' }}
uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 #v 1.25.0
with:
# Send notification to #release slack channel
channel-id: "C024Z61K9QU"
slack-message: ":rocket: New *Rasa SDK* version `${{ needs.define-release-version.outputs.version }}` has been released! More information can be found <https://github.com/RasaHQ/rasa-sdk/releases/tag/${{ needs.define-release-version.outputs.version }}|here>."
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

- name: Notify Slack of unsuccessful release ⛔️
if: ${{ needs.release-artifacts-docker.result != 'success' || needs.release-artifacts-pypi.result != 'success' }}
uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 #v 1.25.0
with:
# Send notification to #devtribe slack channel
channel-id: "C061J0LGHU0"
slack-message: ":broken_heart: *Rasa SDK* release version `${{ needs.define-release-version.outputs.version }}` has failed! More information can be found <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|here>."
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
# - name: Publish Release Notes 🗞
# if: success()
# env:
# GITHUB_TAG: ${{ needs.define-release-version.outputs.version }}
# GITHUB_REPO_SLUG: ${{ github.repository }}
# GITHUB_TOKEN: ${{ secrets.RASASDK_GITHUB_TOKEN }}
# run: |
# GITHUB_TAG=$GITHUB_TAG
# pip install -U github3.py pep440-version-utils
# python3 scripts/publish_gh_release_notes.py

# release-artifact-slack-notifications:
# name: Release Analytics Artifact Slack Notifications
# runs-on: ubuntu-24.04
# needs: [define-release-version, release-artifacts-docker, release-artifacts-pypi, release-atifacts-publish-release]

# if: always() # Ensures this job runs regardless of the result of previous jobs

# steps:
# - name: Notify Slack of successful release 💬
# if: ${{ needs.release-artifacts-docker.result == 'success' && needs.release-artifacts-pypi.result == 'success' }}
# uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 #v 1.25.0
# with:
# # Send notification to #release slack channel
# channel-id: "C024Z61K9QU"
# slack-message: ":rocket: New *Rasa SDK* version `${{ needs.define-release-version.outputs.version }}` has been released! More information can be found <https://github.com/RasaHQ/rasa-sdk/releases/tag/${{ needs.define-release-version.outputs.version }}|here>."
# env:
# SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

# - name: Notify Slack of unsuccessful release ⛔️
# if: ${{ needs.release-artifacts-docker.result != 'success' || needs.release-artifacts-pypi.result != 'success' }}
# uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 #v 1.25.0
# with:
# # Send notification to #devtribe slack channel
# channel-id: "C061J0LGHU0"
# slack-message: ":broken_heart: *Rasa SDK* release version `${{ needs.define-release-version.outputs.version }}` has failed! More information can be found <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|here>."
# env:
# SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

0 comments on commit 57c2191

Please sign in to comment.