diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index fd939040..703af1ac 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -29,7 +29,7 @@ permissions: jobs: quality: name: Code Quality - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: Checkout git repository 🕝 @@ -85,7 +85,7 @@ jobs: test: name: Run Tests - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 strategy: matrix: python-version: [3.8, 3.9, '3.10'] @@ -131,7 +131,7 @@ jobs: docker_linter: name: Lint Dockerfile - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 - name: Lint Dockerfile @@ -141,7 +141,7 @@ jobs: rasa-sdk-dev-docker-image: name: Build dev Docker image - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: Check out code @@ -167,7 +167,7 @@ jobs: rasa-sdk-with-dev-deps-docker-image: name: Build dev Docker image with dev dependencies - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: Check out code @@ -193,7 +193,7 @@ jobs: grpc_standalone_integration_tests: name: Run gRPC integration tests using standalone server - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 needs: [rasa-sdk-with-dev-deps-docker-image] steps: @@ -219,7 +219,7 @@ jobs: grpc_docker_integration_tests: name: Run gRPC integration tests using Docker containers - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 needs: [rasa-sdk-dev-docker-image, rasa-sdk-with-dev-deps-docker-image] steps: diff --git a/.github/workflows/dev-release.yml b/.github/workflows/dev-release.yml new file mode 100644 index 00000000..97e10147 --- /dev/null +++ b/.github/workflows/dev-release.yml @@ -0,0 +1,58 @@ +name: DEV Release Workflow + +on: + workflow_dispatch: + inputs: + version: + description: 'Version to release' + required: true + base-branch: + description: 'Base branch' + required: true + +env: + COMMIT_EMAIL: sara-tagger@users.noreply.github.com + DEFAULT_PYTHON_VERSION: "3.10" + GITHUB_TOKEN: ${{ secrets.RASASDK_GITHUB_TOKEN }} + +jobs: + prepare-dev-release: + name: Prepare DEV Release + if: ${{ github.event_name == 'workflow_dispatch' }} + runs-on: ubuntu-24.04 + steps: + - name: Checkout repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + fetch-depth: 0 + + - name: Check-out base branch + run: | + git checkout $BASE_BRANCH + git branch + env: + BASE_BRANCH: ${{ github.event.inputs.base-branch }} + + - name: Setup Python Environment + uses: ./.github/actions/setup-python-env + with: + PYTHON_VERSION: ${{ env.DEFAULT_PYTHON_VERSION }} + + - name: Prepare the release + run: | + git config user.name "rasabot" + git config user.email "rasabot@rasa.com" + poetry run python scripts/release.py --next_version $INPUT_VERSION + env: + INPUT_VERSION: ${{ github.event.inputs.version }} + + - name: Create pull request + uses: devops-infra/action-pull-request@e66e2ba93519dc63b9884a26e620e2fd0cffab2c # v0.5.5 + with: + github_token: ${{ env.GITHUB_TOKEN }} + source_branch: prepare-release-${{ env.INPUT_VERSION }} + target_branch: ${{ env.BASE_BRANCH }} + body: "**Automated pull request for Rasa SDK release.**" + title: Release ${{ github.event.inputs.version }} + env: + INPUT_VERSION: ${{ github.event.inputs.version }} diff --git a/.github/workflows/git-backup.yml b/.github/workflows/git-backup.yml index 77d3dc85..9979451e 100644 --- a/.github/workflows/git-backup.yml +++ b/.github/workflows/git-backup.yml @@ -11,7 +11,7 @@ permissions: jobs: backup: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: Checkout repository uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c diff --git a/.github/workflows/pr-cleanup.yml b/.github/workflows/pr-cleanup.yml index 8d834605..2332880e 100644 --- a/.github/workflows/pr-cleanup.yml +++ b/.github/workflows/pr-cleanup.yml @@ -15,7 +15,7 @@ jobs: # Skip any PR created by dependabot to avoid permission issues if: (github.actor != 'dependabot[bot]') name: Delete PR Docker Images - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@8c3f20df09ac63af7b3ae3d7c91f105f857d8497 #v3.0.1 diff --git a/.github/workflows/pr-merged.yml b/.github/workflows/pr-merged.yml index 25bcbb27..5be91b50 100644 --- a/.github/workflows/pr-merged.yml +++ b/.github/workflows/pr-merged.yml @@ -20,7 +20,7 @@ permissions: jobs: rasa-sdk-dev-docker-image: name: Build Dev Docker Image and Push to AWS - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: Check out code diff --git a/.github/workflows/release-artifacts.yml b/.github/workflows/release-artifacts.yml index 5b44ce0e..1fa9b515 100644 --- a/.github/workflows/release-artifacts.yml +++ b/.github/workflows/release-artifacts.yml @@ -5,101 +5,70 @@ on: tags: - "*" workflow_dispatch: + inputs: + tag_version: + description: 'Tag version:' + required: true jobs: - build_docker_image_set_env: - name: Prepare environment for Docker build - runs-on: ubuntu-22.04 - if: github.repository == 'RasaHQ/rasa-sdk' + define-release-version: + name: Define Release Version + runs-on: ubuntu-24.04 + outputs: - # Tag name used for intermediate images created during Docker image builds, e.g. 3886 - a PR number - image_tag: ${{ steps.set_output.outputs.image_tag }} - # Return 'true' if tag version is equal or higher than the latest tagged rasa-sdk version - is_newest_version: ${{ steps.rasa_sdk_get_version.outputs.is_newest_version }} + version: ${{ steps.set-tag-version.outputs.tag_version }} + steps: - - name: Checkout git repository 🕝 - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 - - # Set environment variables for a tag - # - # In this scenario, we've pushed the '2.4.1' tag - # - # Example output: - # IMAGE_TAG=2.4.1 - - name: Set image_tag + - name: Define release version + id: set-tag-version run: | - TAG_NAME=${GITHUB_REF#refs/tags/} - echo "IMAGE_TAG=${TAG_NAME}" >> $GITHUB_ENV - echo "image_tag=${{ env.IMAGE_TAG }}" >> $GITHUB_OUTPUT - - - name: Set is_newest_version - id: rasa_sdk_get_version - run: | - # Get latest tagged rasa-sdk version - git fetch --depth=1 origin "+refs/tags/*:refs/tags/*" - # Fetch branch history - git fetch --prune --unshallow - LATEST_TAGGED_NON_ALPHA_RASA_SDK_VERSION=$(git tag | sort -r -V | grep -E "^[0-9.]+$" | head -n1) - CURRENT_TAG=${GITHUB_REF#refs/tags/} - # Return 'true' if tag version is equal or higher than the latest tagged rasa-sdk version - IS_NEWEST_VERSION=$((printf '%s\n%s\n' "${LATEST_TAGGED_NON_ALPHA_RASA_SDK_VERSION}" "$CURRENT_TAG" \ - | sort -V -C && echo true || echo false) || true) - - - if [[ "${IS_NEWEST_VERSION}" == "true" && "$CURRENT_TAG" =~ ^[0-9.]+$ ]]; then - echo "is_newest_version=true" >> $GITHUB_OUTPUT + if [[ -n "$GITHUB_REF" && "$GITHUB_REF" == refs/tags/* ]]; then + echo "tag_version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT + elif [[ -n "$INPUT_TAG_VERSION" ]]; then + echo "tag_version=$INPUT_TAG_VERSION" >> $GITHUB_OUTPUT else - echo "is_newest_version=false" >> $GITHUB_OUTPUT + echo "No tag version found." + exit 1 fi - - build_docker_image: - name: Build Docker image - runs-on: ubuntu-22.04 - needs: [ build_docker_image_set_env ] - if: github.repository == 'RasaHQ/rasa-sdk' - + env: + INPUT_TAG_VERSION: ${{ github.event.inputs.tag_version }} + + release-artifacts-docker: + name: Release Artifacts Docker + runs-on: ubuntu-24.04 + needs: define-release-version + steps: - - name: Checkout git repository 🕝 - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 - + - name: Check out code + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + ref: ${{ needs.define-release-version.outputs.version }} + - name: Set up QEMU uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0 - name: Set up Docker Buildx uses: docker/setup-buildx-action@0d103c3126aa41d772a8362f6aa67afac040f80c # v3.1.0 - - name: Set environment variables - run: | - echo "IMAGE_TAG=${{ needs.build_docker_image_set_env.outputs.image_tag }}" >> $GITHUB_ENV - - 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 📦 run: | - IS_NEWEST_VERSION=${{ needs.build_docker_image_set_env.outputs.is_newest_version }} - - # Push image - IMAGE_NAME=rasa/rasa-sdk \ - IMAGE_TAG=${GITHUB_REF#refs/tags/} \ + IMAGE_NAME=rasa/rasa-sdk + IMAGE_TAG="${{ needs.define-release-version.outputs.version }}" make build-and-push-multi-platform-docker - - # Tag the image as latest - if [[ "${IS_NEWEST_VERSION}" == "true" ]]; then - IMAGE_TAG=latest \ - make build-and-push-multi-platform-docker - fi - - deploy: - name: Deploy to PyPI - runs-on: ubuntu-22.04 - - # deploy will only be run when there is a tag available - needs: [ build_docker_image ] # only run after all other stages succeeded - + + release-artifacts-pypi: + name: Release Artifacts PyPI + runs-on: ubuntu-24.04 + needs: define-release-version + steps: - name: Checkout git repository 🕝 - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 + 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 @@ -126,37 +95,53 @@ jobs: 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: env.IS_TAG_BUILD + if: success() env: - GITHUB_TAG: ${{ github.ref }} + GITHUB_TAG: ${{ needs.define-release-version.outputs.version }} GITHUB_REPO_SLUG: ${{ github.repository }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.RASASDK_GITHUB_TOKEN }} run: | - GITHUB_TAG=${GITHUB_TAG/refs\/tags\//} - sudo apt-get update - sudo apt-get -y install pandoc - pip install -U github3.py pep440_version_utils - python3 ${GITHUB_WORKSPACE}/scripts/publish_gh_release_notes.py + GITHUB_TAG=$GITHUB_TAG + pip install -U github3.py pep440-version-utils + python3 scripts/publish_gh_release_notes.py - - name: Get RASA SDK Version - env: - RASA_SDK_VERSION: ${{ github.ref }} - run: | - echo "RASA_SDK_VERSION=${RASA_SDK_VERSION/refs\/tags\//}" >> $GITHUB_ENV + 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] - - name: Notify Slack 💬 - if: success() - env: - SLACK_WEBHOOK: ${{ secrets.SLACK_RELEASE_ASSISTANT_RELEASE_WEBHOOK }} - uses: Ilshidur/action-slack@2.1.0 - with: - args: "⚡ New *Rasa SDK* version ${{ env.RASA_SDK_VERSION }} has been released! Changelog: https://github.com/RasaHQ/rasa-sdk/blob/${{ env.RASA_SDK_VERSION }}/CHANGELOG.mdx" + if: always() # Ensures this job runs regardless of the result of previous jobs - - name: Notify Slack of Failure ⛔ - if: failure() + 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 ." env: - SLACK_WEBHOOK: ${{ secrets.SLACK_RELEASE_ASSISTANT_DEV_TRIBE_WEBHOOK }} - uses: Ilshidur/action-slack@2.1.0 + 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: - args: "⛔️ *Rasa SDK* version ${{ env.RASA_SDK_VERSION }} could not be released 😱 GitHub Actions: https://github.com/RasaHQ/rasa-sdk/actions?query=branch%3A${{ env.RASA_SDK_VERSION }}" + # 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 ." + env: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..09c4dc59 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,156 @@ +name: Release Workflow + +on: + workflow_dispatch: + inputs: + version: + description: 'Version to release' + required: true + pull_request: + branches: + - main + - '[0-9]+.[0-9]+.x' + types: [closed] + +env: + COMMIT_EMAIL: sara-tagger@users.noreply.github.com + DEFAULT_PYTHON_VERSION: "3.10" + GITHUB_TOKEN: ${{ secrets.RASASDK_GITHUB_TOKEN }} + INPUT_VERSION: ${{ github.event.inputs.version }} + +jobs: + prepare-the-release: + name: Prepare the Release + if: ${{ github.event_name == 'workflow_dispatch' }} + runs-on: ubuntu-24.04 + steps: + - name: Checkout repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + fetch-depth: 0 + + - name: Minor Release Check + id: minor_release + run: | + version="$INPUT_VERSION" + + # Check if version is in format number.number.number + if ! [[ $version =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "Invalid version format. It should be in format 'number.number.number'." + exit 1 + fi + + # Extract the third number + IFS='.' read -r -a version_parts <<< "$version" + third_number="${version_parts[2]}" + + # Check if it's a minor release + if [ "$third_number" -eq 0 ]; then + echo "Minor release detected." + echo "is_minor=true" >> $GITHUB_ENV + else + echo "Not a minor release. Skipping branch creation." + echo "is_minor=false" >> $GITHUB_ENV + fi + + - name: Create and Push New Release Branch + if: env.is_minor == 'true' + run: | + version="$INPUT_VERSION" + IFS='.' read -r -a version_parts <<< "$version" + release_branch="${version_parts[0]}.${version_parts[1]}.x" + + git fetch origin + git checkout origin/main + git checkout -b $release_branch + git push origin $release_branch + + - name: Check-out Release Branch + run: | + version="$INPUT_VERSION" + IFS='.' read -r -a version_parts <<< "$version" + release_branch="${version_parts[0]}.${version_parts[1]}.x" + echo "base_branch=${version_parts[0]}.${version_parts[1]}.x" >> $GITHUB_ENV + echo $base_branch + + git checkout $release_branch + git branch + + - name: Setup Python Environment + uses: ./.github/actions/setup-python-env + with: + PYTHON_VERSION: ${{ env.DEFAULT_PYTHON_VERSION }} + + - name: Prepare the release + run: | + git config user.name "rasabot" + git config user.email "rasabot@rasa.com" + poetry run python scripts/release.py --next_version $INPUT_VERSION + + - name: Create pull request + uses: devops-infra/action-pull-request@e66e2ba93519dc63b9884a26e620e2fd0cffab2c # v0.5.5 + with: + github_token: ${{ env.GITHUB_TOKEN }} + source_branch: prepare-release-${{ env.INPUT_VERSION }} + target_branch: ${{ env.base_branch }} + body: "**Automated pull request for Rasa SDK release.**" + title: Release ${{ github.event.inputs.version }} + + if_merged_tag_release: + name: Tag Release Version + if: startsWith(github.head_ref, 'prepare-release-') && github.event.pull_request.merged == true + runs-on: ubuntu-24.04 + steps: + - name: Checkout git repository 🕝 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 + with: + token: ${{ secrets.RELEASE_TAGGER_PAT }} + + - name: Set up Python ${{ env.DEFAULT_PYTHON_VERSION }} 🐍 + uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0 + with: + python-version: ${{ env.DEFAULT_PYTHON_VERSION }} + + - name: Read Poetry Version 🔢 + run: | + echo "POETRY_VERSION=$(scripts/poetry-version.sh)" >> $GITHUB_ENV + shell: bash + + - name: Install poetry 🦄 + uses: Gr1N/setup-poetry@15821dc8a61bc630db542ae4baf6a7c19a994844 # v8 + with: + poetry-version: ${{ env.POETRY_VERSION }} + + - name: Load Poetry Cached Libraries ⬇ + id: cache-poetry + uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 + with: + path: .venv + key: ${{ runner.os }}-poetry-${{ env.POETRY_VERSION }}-${{ env.DEFAULT_PYTHON_VERSION }}-${{ hashFiles('**/poetry.lock') }}-${{ secrets.POETRY_CACHE_VERSION }} + restore-keys: ${{ runner.os }}-poetry-${{ env.DEFAULT_PYTHON_VERSION }} + + - name: Clear Poetry cache + if: steps.cache-poetry.outputs.cache-hit == 'true' && contains(github.event.pull_request.labels.*.name, 'tools:clear-poetry-cache-unit-tests') + run: rm -r .venv + + - name: Create virtual environment + if: steps.cache-poetry.outputs.cache-hit != 'true' || contains(github.event.pull_request.labels.*.name, 'tools:clear-poetry-cache-unit-tests') + run: python -m venv create .venv + + - name: Set up virtual environment + run: poetry config virtualenvs.in-project true + + - name: Install Dependencies 📦 + # Poetry intermittently fails to install dependency if it is not PEP 517 compliant + # This is a workaround for that issue + run: | + sudo apt-get -y install libpq-dev + make install + + - name: Configure git + run: | + git config --global user.email ${{ env.COMMIT_EMAIL }} + git config --global user.name "Github Actions" + + - name: Tag Release + run: make tag-release \ No newline at end of file diff --git a/.github/workflows/scan_docker_image_dependencies.yml b/.github/workflows/scan_docker_image_dependencies.yml index e8f00323..2fa14070 100644 --- a/.github/workflows/scan_docker_image_dependencies.yml +++ b/.github/workflows/scan_docker_image_dependencies.yml @@ -5,7 +5,7 @@ on: jobs: scan_and_alert: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: Checkout repository to check tags diff --git a/.github/workflows/security-patching.yml b/.github/workflows/security-patching.yml index f86b364a..4c58a668 100644 --- a/.github/workflows/security-patching.yml +++ b/.github/workflows/security-patching.yml @@ -17,7 +17,7 @@ permissions: jobs: get_tags: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 continue-on-error: true outputs: tags: ${{ steps.tags.outputs.tags }} @@ -61,7 +61,7 @@ jobs: build: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 needs: get_tags # Don't allow a single image failure to block all the image builds. continue-on-error: true diff --git a/.github/workflows/security-scans.yml b/.github/workflows/security-scans.yml index 93dd1a0c..60cc4282 100644 --- a/.github/workflows/security-scans.yml +++ b/.github/workflows/security-scans.yml @@ -8,7 +8,7 @@ jobs: trivy: name: Detecting hardcoded secrets - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 with: diff --git a/.github/workflows/semgrep-check.yml b/.github/workflows/semgrep-check.yml index 10e428e9..615e239b 100644 --- a/.github/workflows/semgrep-check.yml +++ b/.github/workflows/semgrep-check.yml @@ -14,7 +14,7 @@ jobs: # User-definable name of this GitHub Actions job: name: Semgrep Workflow Security Scan # If you are self-hosting, change the following `runs-on` value: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 container: # A Docker image with Semgrep installed. Do not change this. diff --git a/.github/workflows/spellcheck.yml b/.github/workflows/spellcheck.yml index 70b421d1..57be6108 100644 --- a/.github/workflows/spellcheck.yml +++ b/.github/workflows/spellcheck.yml @@ -7,7 +7,7 @@ on: jobs: spellcheck: name: Typo CI (GitHub Action) - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 timeout-minutes: 4 if: "!contains(github.event.head_commit.message, '[ci skip]')" steps: diff --git a/.github/workflows/tag-release.yml b/.github/workflows/tag-release.yml deleted file mode 100644 index 6a570e7b..00000000 --- a/.github/workflows/tag-release.yml +++ /dev/null @@ -1,72 +0,0 @@ -name: Tag Release Version -on: - pull_request: - branches: - - main - - '[0-9]+.[0-9]+.x' - types: [closed] - workflow_dispatch: - -env: - COMMIT_EMAIL: sara-tagger@users.noreply.github.com - DEFAULT_PYTHON_VERSION: "3.10" - -jobs: - if_merged_tag_release: - name: Tag Release Version - if: startsWith(github.head_ref, 'prepare-release-') && github.event.pull_request.merged == true - runs-on: ubuntu-22.04 - steps: - - name: Checkout git repository 🕝 - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 - with: - token: ${{ secrets.RELEASE_TAGGER_PAT }} - - - name: Set up Python ${{ env.DEFAULT_PYTHON_VERSION }} 🐍 - uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0 - with: - python-version: ${{ env.DEFAULT_PYTHON_VERSION }} - - - name: Read Poetry Version 🔢 - run: | - echo "POETRY_VERSION=$(scripts/poetry-version.sh)" >> $GITHUB_ENV - shell: bash - - - name: Install poetry 🦄 - uses: Gr1N/setup-poetry@15821dc8a61bc630db542ae4baf6a7c19a994844 # v8 - with: - poetry-version: ${{ env.POETRY_VERSION }} - - - name: Load Poetry Cached Libraries ⬇ - id: cache-poetry - uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 #v4.0.0 - with: - path: .venv - key: ${{ runner.os }}-poetry-${{ env.POETRY_VERSION }}-${{ env.DEFAULT_PYTHON_VERSION }}-${{ hashFiles('**/poetry.lock') }}-${{ secrets.POETRY_CACHE_VERSION }} - restore-keys: ${{ runner.os }}-poetry-${{ env.DEFAULT_PYTHON_VERSION }} - - - name: Clear Poetry cache - if: steps.cache-poetry.outputs.cache-hit == 'true' && contains(github.event.pull_request.labels.*.name, 'tools:clear-poetry-cache-unit-tests') - run: rm -r .venv - - - name: Create virtual environment - if: steps.cache-poetry.outputs.cache-hit != 'true' || contains(github.event.pull_request.labels.*.name, 'tools:clear-poetry-cache-unit-tests') - run: python -m venv create .venv - - - name: Set up virtual environment - run: poetry config virtualenvs.in-project true - - - name: Install Dependencies 📦 - # Poetry intermittently fails to install dependency if it is not PEP 517 compliant - # This is a workaround for that issue - run: | - sudo apt-get -y install libpq-dev - make install - - - name: Configure git - run: | - git config --global user.email ${{ env.COMMIT_EMAIL }} - git config --global user.name "Github Actions" - - - name: Tag Release - run: make tag-release diff --git a/scripts/publish_gh_release_notes.py b/scripts/publish_gh_release_notes.py index f96d8b08..99d1050b 100644 --- a/scripts/publish_gh_release_notes.py +++ b/scripts/publish_gh_release_notes.py @@ -81,7 +81,7 @@ def main(): return 1 version = Version(tag_name) - if version.pre: + if version.pre or version.dev: md_body = "_Pre-release version_" else: md_body = parse_changelog(tag_name)