Skip to content

Commit b14e833

Browse files
authored
Fix sdk publishing action to skip tests correctly (#1566)
2 parents 806d951 + 9dc8175 commit b14e833

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

.github/workflows/publish.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,8 @@ on:
88
required: true
99
skip-tests:
1010
description: 'Skip PROD Test (Do not do this unless there is an emergency)'
11-
default: 'false'
12-
required: true
13-
type: choice
14-
options:
15-
- false
16-
- true
11+
default: false
12+
type: boolean
1713

1814

1915
concurrency:
@@ -52,7 +48,7 @@ jobs:
5248
name: build
5349
path: ./dist
5450
test-build:
55-
if: ${{ inputs.skip-tests }} != "true"
51+
if: ${{ !inputs.skip-tests }}
5652
needs: ['build']
5753
runs-on: ubuntu-latest
5854
strategy:
@@ -121,7 +117,10 @@ jobs:
121117
rye run pytest tests/data
122118
pypi-publish:
123119
runs-on: ubuntu-latest
124-
needs: ['test-build']
120+
needs: ['build', 'test-build']
121+
if: |
122+
always() &&
123+
(needs.test-build.result == 'success' || needs.test-build.result == 'skipped') && github.event.inputs.tag
125124
environment:
126125
name: publish
127126
url: 'https://pypi.org/project/labelbox/'
@@ -138,7 +137,10 @@ jobs:
138137
packages-dir: artifact/
139138
container-publish:
140139
runs-on: ubuntu-latest
141-
needs: ['test-build']
140+
needs: ['build', 'test-build']
141+
if: |
142+
always() &&
143+
(needs.test-build.result == 'success' || needs.test-build.result == 'skipped') && github.event.inputs.tag
142144
env:
143145
CONTAINER_IMAGE: "ghcr.io/${{ github.repository }}"
144146
steps:

0 commit comments

Comments
 (0)