Skip to content
7 changes: 7 additions & 0 deletions .github/workflows/bump-stage-and-upload-to-jfrog.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
on:
workflow_call:
inputs:
dry-run:
required: false
default: false
type: boolean
description: "Don't tag or upload anything to JFrog"
passed-dev-tag:
type: string
description: Dev tag to fast forward the stage branch to
Expand Down Expand Up @@ -31,6 +36,7 @@ jobs:
with:
change: 'promote-dev-build-to-rc'
ref: ${{ vars.STAGE_BRANCH_NAME }}
dry-run: ${{ inputs.dry-run }}
secrets: inherit

rebuild-artifacts-with-rc-version:
Expand All @@ -50,6 +56,7 @@ jobs:
uses: ./.github/workflows/upload-to-jfrog.yml
with:
version: ${{ needs.promote-dev-build-to-rc.outputs.new_version }}
dry-run: ${{ inputs.dry-run }}
secrets: inherit

# See reason for deleting artifacts in dev-workflow-p2.yml
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ name: Bump version
on:
workflow_dispatch:
inputs:
dry-run:
required: false
default: false
type: boolean
description: "Don't tag"
change:
type: choice
description: Python script name to update the version
Expand All @@ -15,6 +20,11 @@ on:
- promote-rc-build-to-release
workflow_call:
inputs:
dry-run:
required: false
default: false
type: boolean
description: "Don't tag"
change:
# Since workflow_call doesn't support 'options' input type,
# we take in a string instead that must be a valid Python script name (excluding the .py part)
Expand Down Expand Up @@ -93,4 +103,5 @@ jobs:
with:
new_version: ${{ needs.get-new-version.outputs.new_version }}
ref: ${{ inputs.is_workflow_call && inputs.ref || github.ref }}
dry-run: ${{ inputs.dry-run }}
secrets: inherit
23 changes: 23 additions & 0 deletions .github/workflows/dev-to-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,25 @@ name: Dev to stage
on:
# This workflow manipulates the stage and dev branches regardless of the branch this workflow is run from
workflow_dispatch:
inputs:
registry-name:
required: true
default: docker.io
description: 'Docker registry'
server-tag:
required: true
default: 'latest'
description: 'Server docker image tag'
# For debugging
dry-run:
required: false
default: false
type: boolean
description: "Don't tag or upload anything to JFrog"
test-file:
required: false
default: ''
description: 'new_tests/<value>'

jobs:
# We want to skip the stage tests if the changes made between dev and stage wouldn't affect the results of the stage tests
Expand Down Expand Up @@ -46,6 +65,9 @@ jobs:
with:
use_jfrog_builds: true
jfrog-build-version-to-test: ${{ needs.compare-latest-dev-tag-and-stage.outputs.latest-dev-tag }}
registry-name: ${{ inputs.registry-name }}
server-tag: ${{ inputs.server-tag }}
test-file: ${{ inputs.test-file }}

# Stage tests have passed or skipped
# so it is safe to update the stage branch with the changes in dev, promote the version to an RC, and rebuild and upload the RC to JFrog
Expand All @@ -62,4 +84,5 @@ jobs:
uses: ./.github/workflows/bump-stage-and-upload-to-jfrog.yml
with:
passed-dev-tag: ${{ needs.compare-latest-dev-tag-and-stage.outputs.latest-dev-tag }}
dry-run: ${{ inputs.dry-run }}
secrets: inherit
9 changes: 7 additions & 2 deletions .github/workflows/stage-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ on:
required: false
default: 'latest'
description: 'Server docker image tag'
test-file:
required: false
default: ''
type: string
description: 'new_tests/<value>'
test-macos-x86:
required: false
type: boolean
Expand Down Expand Up @@ -176,7 +181,7 @@ jobs:
run: docker exec --workdir /aerospike-client-python/test ${{ env.LINUX_DISTRO_CONTAINER_NAME }} python${{ env.PYTHON_VERSION }} -m ${{ env.PIP_INSTALL_COMMAND }} pytest -c requirements.txt

- name: Run tests
run: docker exec --workdir /aerospike-client-python/test ${{ env.LINUX_DISTRO_CONTAINER_NAME }} python${{ env.PYTHON_VERSION }} -m pytest new_tests/
run: docker exec --workdir /aerospike-client-python/test ${{ env.LINUX_DISTRO_CONTAINER_NAME }} python${{ env.PYTHON_VERSION }} -m pytest new_tests/${{ inputs.test-file }}

macOS:
if: ${{ inputs.test-macos-x86 }}
Expand Down Expand Up @@ -251,7 +256,7 @@ jobs:

- name: Run tests
if: ${{ matrix.runner-os-and-arch[1] == 'x86_64' }}
run: python3 -m pytest new_tests/
run: python3 -m pytest new_tests/${{ inputs.test-file }}
working-directory: test

- name: Run tests on macos 26
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/update-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,22 @@ name: Update version in repo
on:
workflow_dispatch:
inputs:
dry-run:
required: false
default: false
type: boolean
description: "Don't tag"
new_version:
type: string
description: Version string to set in the repo
required: true
workflow_call:
inputs:
dry-run:
required: false
default: false
type: boolean
description: "Don't tag"
new_version:
type: string
description: Version string to set in the repo
Expand Down Expand Up @@ -61,7 +71,7 @@ jobs:
with:
commit_message: 'Auto-bump version to ${{ inputs.new_version }} [skip ci]'
commit_author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
tagging_message: ${{ inputs.new_version }}
tagging_message: ${{ !inputs.dry-run && inputs.new_version || '' }}
branch: ${{ inputs.is_workflow_call && inputs.ref || github.ref }}

- name: Output bump commit hash for next jobs to use
Expand Down
14 changes: 11 additions & 3 deletions .github/workflows/upload-to-jfrog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ name: Upload to JFrog
on:
workflow_call:
inputs:
dry-run:
required: false
default: false
type: boolean
description: "Don't upload to jfrog"
version:
type: string
required: false
Expand Down Expand Up @@ -39,19 +44,22 @@ jobs:
JF_URL: ${{ secrets.JFROG_PLATFORM_URL }}
JF_ACCESS_TOKEN: ${{ secrets.JFROG_ACCESS_TOKEN }}

- if: ${{ inputs.dry-run }}
run: echo "DRY_RUN_FLAG=--dry-run" >> $GITHUB_ENV

- name: Upload manylinux builds from arbitrary branches to JFrog generic repo
if: ${{ inputs.jfrog-repo-name == vars.JFROG_GENERIC_REPO_NAME }}
run: jf rt upload "*manylinux*" ${{ vars.JFROG_GENERIC_REPO_NAME }}/${{ github.ref_name }}/
run: jf rt upload $DRY_RUN_FLAG "*manylinux*" ${{ vars.JFROG_GENERIC_REPO_NAME }}/${{ github.ref_name }}/
working-directory: artifacts

- name: Upload passing builds to JFrog PyPI repo
if: ${{ inputs.jfrog-repo-name == vars.JFROG_REPO_NAME }}
# Source path must be in quotes if it contains an asterisk
# https://github.com/jfrog/jfrog-cli/issues/1775#issuecomment-1348986551
run: jf rt upload --build-name python-client --build-number $NEW_VERSION "artifacts/*" ${{ vars.JFROG_REPO_NAME }}/aerospike/$NEW_VERSION/
run: jf rt upload $DRY_RUN_FLAG --build-name python-client --build-number $NEW_VERSION "artifacts/*" ${{ vars.JFROG_REPO_NAME }}/aerospike/$NEW_VERSION/
env:
NEW_VERSION: ${{ inputs.version }}

- name: Publish build info
if: ${{ inputs.jfrog-repo-name == vars.JFROG_REPO_NAME }}
run: jf rt build-publish python-client ${{ inputs.version }}
run: jf rt build-publish $DRY_RUN_FLAG python-client ${{ inputs.version }}
Loading