Skip to content

Commit f03f9b2

Browse files
author
Val Brodsky
committed
Add sdk version support for develop action
1 parent d40922e commit f03f9b2

File tree

2 files changed

+32
-3
lines changed

2 files changed

+32
-3
lines changed

.github/workflows/python-package-develop.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,29 @@ jobs:
2828
filters: |
2929
labelbox:
3030
- 'libs/labelbox/**'
31+
get_sdk_versions:
32+
runs-on: ubuntu-latest
33+
outputs:
34+
sdk_versions: ${{ steps.get_sdk_versions.outputs.sdk_versions }}
35+
steps:
36+
- name: Checkout repository
37+
uses: actions/checkout@v2
38+
with:
39+
ref: ${{ github.head_ref }}
40+
- name: Get Latest SDK versions
41+
id: get_sdk_versions
42+
run: |
43+
TAGS=$(git tag --list --sort=-version:refname "v.*" | head -n 4)
44+
if [ -z "$TAGS" ]; then
45+
echo "No tags found"
46+
exit 1
47+
fi
48+
echo "TAGS=$TAGS" >> $GITHUB_ENV
49+
echo "::set-output name=sdk_versions::$TAGS"
50+
51+
3152
build:
32-
needs: ['path-filter']
53+
needs: ['path-filter', 'get_sdk_versions']
3354
if: ${{ needs.path-filter.outputs.labelbox == 'true' }}
3455
strategy:
3556
fail-fast: false
@@ -38,15 +59,19 @@ jobs:
3859
- python-version: 3.8
3960
api-key: STAGING_LABELBOX_API_KEY_2
4061
da-test-key: DA_GCP_LABELBOX_API_KEY
62+
sdk-version: ${{ needs.get_sdk_versions.outputs.sdk_versions }}[3]
4163
- python-version: 3.9
4264
api-key: STAGING_LABELBOX_API_KEY_3
4365
da-test-key: DA_GCP_LABELBOX_API_KEY
66+
sdk-version: ${{ needs.get_sdk_versions.outputs.sdk_versions }}[2]
4467
- python-version: "3.10"
4568
api-key: STAGING_LABELBOX_API_KEY_4
4669
da-test-key: DA_GCP_LABELBOX_API_KEY
70+
sdk-version: ${{ needs.get_sdk_versions.outputs.sdk_versions }}[1]
4771
- python-version: 3.11
4872
api-key: STAGING_LABELBOX_API_KEY
4973
da-test-key: DA_GCP_LABELBOX_API_KEY
74+
sdk-version: ${{ needs.get_sdk_versions.outputs.sdk_versions }}[0]
5075
- python-version: 3.12
5176
api-key: STAGING_LABELBOX_API_KEY_5
5277
da-test-key: DA_GCP_LABELBOX_API_KEY
@@ -55,6 +80,7 @@ jobs:
5580
python-version: ${{ matrix.python-version }}
5681
api-key: ${{ matrix.api-key }}
5782
da-test-key: ${{ matrix.da-test-key }}
83+
sdk-version: ${{ matrix.sdk-version }}
5884
fixture-profile: true
5985
test-env: 'staging'
6086
secrets: inherit

.github/workflows/python-package-shared.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ on:
1212
da-test-key:
1313
required: true
1414
type: string
15+
sdk-version:
16+
required: false
17+
type: string
1518
test-env:
1619
required: true
1720
type: string
@@ -41,7 +44,7 @@ jobs:
4144
steps:
4245
- uses: actions/checkout@v4
4346
with:
44-
ref: ${{ github.head_ref }}
47+
ref: ${{ inputs.sdk-version || github.head_ref }}
4548
- uses: ./.github/actions/python-package-shared-setup
4649
with:
4750
rye-version: ${{ vars.RYE_VERSION }}
@@ -61,7 +64,7 @@ jobs:
6164
steps:
6265
- uses: actions/checkout@v4
6366
with:
64-
ref: ${{ github.head_ref }}
67+
ref: ${{ inputs.sdk-version || github.head_ref }}
6568
- uses: ./.github/actions/python-package-shared-setup
6669
with:
6770
rye-version: ${{ vars.RYE_VERSION }}

0 commit comments

Comments
 (0)