Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DEVOPS-234] CI/CD: Allow QE to remotely build manylinux wheels from feature branches and upload them to JFrog #637

Draft
wants to merge 12 commits into
base: dev
Choose a base branch
from
22 changes: 9 additions & 13 deletions .github/workflows/build-and-upload-wheels-for-qe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,27 @@ name: Build and upload wheels for QE
run-name: Build and upload wheels for QE (disable-optimizations=${{ github.event_name == 'workflow_dispatch' && inputs.disable-optimizations || false }})

on:
push:
branches-ignore:
- dev*
- stage*
- master*
workflow_dispatch:
inputs:
disable-optimizations:
description: 'Build unoptimized wheels?'
default: false
type: boolean
required: false
python-tags:
type: string
required: true
platform-tag:
type: string
required: true

jobs:
build-artifacts:
strategy:
matrix:
platform-tag: [
"manylinux_x86_64",
"manylinux_aarch64"
]
uses: ./.github/workflows/build-wheels.yml
with:
platform-tag: ${{ matrix.platform-tag }}
unoptimized: ${{ github.event_name == 'workflow_dispatch' && inputs.disable-optimizations || false }}
python-tags: ${{ inputs.python-tags }}
platform-tag: ${{ inputs.platform-tag }}
unoptimized: ${{ inputs.disable-optimizations }}
sha-to-build-and-test: ${{ github.sha }}
secrets: inherit

Expand Down
26 changes: 14 additions & 12 deletions .github/workflows/upload-to-jfrog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ on:

jobs:
upload-to-jfrog:
env:
ARTIFACT_FOLDER_PATH: artifacts
name: Upload artifacts to JFrog
runs-on: ubuntu-22.04
steps:
Expand All @@ -26,27 +28,27 @@ jobs:
with:
pattern: '*.build'
merge-multiple: true
path: artifacts
path: ${{ env.ARTIFACT_FOLDER_PATH }}

- name: Set up JFrog credentials
uses: jfrog/setup-jfrog-cli@v3
env:
JF_URL: ${{ secrets.JFROG_PLATFORM_URL }}
JF_ACCESS_TOKEN: ${{ secrets.JFROG_ACCESS_TOKEN }}

- 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 }}/
working-directory: artifacts

- name: Upload passing builds to JFrog PyPI repo
- name: 'JFrog PyPI upload: link JFrog build with these artifacts'
if: ${{ inputs.jfrog-repo-name == vars.JFROG_REPO_NAME }}
# Source path must be in quotes if it contains an asterisk
run: echo JFROG_BUILD_OPTS="--build-name python-client --build-number ${{ inputs.version }}" >> $GITHUB_ENV

- name: Choose folder to upload artifacts to
run: echo REPO_FOLDER_PATH="${{ inputs.jfrog-repo-name == vars.JFROG_REPO_NAME && format('aerospike/{0}/{1}', inputs.version, env.ARTIFACT_FOLDER_PATH) || github.ref_name }}/" >> $GITHUB_ENV

- name: Upload artifacts to JFrog
# 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/
env:
NEW_VERSION: ${{ inputs.version }}
run: jf rt upload ${{ env.JFROG_BUILD_OPTS }} "*" ${{ inputs.jfrog-repo-name }}/${{ env.REPO_FOLDER_PATH }}
working-directory: ${{ env.ARTIFACT_FOLDER_PATH }}

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