Skip to content

Commit b602569

Browse files
author
Val Brodsky
committed
Temp add a workflow file to run prod tests
1 parent 9c42ec4 commit b602569

File tree

3 files changed

+55
-120
lines changed

3 files changed

+55
-120
lines changed

.github/workflows/lbox-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
steps:
2626
- uses: actions/checkout@v4
2727
with:
28-
ref: ${{ inputs.tag }}
28+
ref: v.6.0.1
2929
- uses: dorny/paths-filter@v3
3030
id: filter
3131
with:

.github/workflows/publish.yml

Lines changed: 0 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,6 @@ jobs:
6363
with:
6464
name: build
6565
path: ./dist
66-
provenance_python:
67-
needs: [build]
68-
permissions:
69-
actions: read
70-
contents: write
71-
id-token: write # Needed to access the workflow's OIDC identity.
72-
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v2.0.0
73-
with:
74-
base64-subjects: "${{ needs.build.outputs.hashes }}"
75-
upload-assets: true
76-
upload-tag-name: ${{ inputs.tag }} # Tag from the initiation of the workflow
7766
test-build:
7867
if: ${{ !inputs.skip-tests }}
7968
needs: ['build']
@@ -138,111 +127,3 @@ jobs:
138127
rye add labelbox --path ./$(find ./dist/ -name *.tar.gz) --sync --absolute --features data
139128
cd libs/labelbox
140129
rye run pytest tests/data
141-
publish-python-package-to-release:
142-
runs-on: ubuntu-latest
143-
needs: ['build']
144-
permissions:
145-
contents: write
146-
steps:
147-
- uses: actions/checkout@v4
148-
with:
149-
ref: ${{ inputs.tag }}
150-
- uses: actions/download-artifact@v4
151-
with:
152-
name: build
153-
path: ./artifact
154-
- name: Upload dist to release
155-
run: |
156-
gh release upload ${{ inputs.tag }} ./artifact/*
157-
env:
158-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
159-
pypi-publish:
160-
runs-on: ubuntu-latest
161-
needs: ['build', 'test-build']
162-
if: |
163-
always() &&
164-
(needs.test-build.result == 'success' || needs.test-build.result == 'skipped') && github.event.inputs.tag
165-
environment:
166-
name: publish
167-
url: 'https://pypi.org/project/labelbox/'
168-
permissions:
169-
# IMPORTANT: this permission is mandatory for trusted publishing
170-
id-token: write
171-
steps:
172-
- uses: actions/download-artifact@v4
173-
with:
174-
name: build
175-
path: ./artifact
176-
- name: Publish package distributions to PyPI
177-
uses: pypa/gh-action-pypi-publish@release/v1
178-
with:
179-
packages-dir: artifact/
180-
container-publish:
181-
runs-on: ubuntu-latest
182-
needs: ['build', 'test-build']
183-
permissions:
184-
packages: write
185-
outputs:
186-
image: ${{ steps.image.outputs.image }}
187-
digest: ${{ steps.build_container.outputs.digest }}
188-
if: |
189-
always() &&
190-
(needs.test-build.result == 'success' || needs.test-build.result == 'skipped') && github.event.inputs.tag
191-
env:
192-
CONTAINER_IMAGE: "ghcr.io/${{ github.repository }}"
193-
steps:
194-
- uses: actions/checkout@v4
195-
with:
196-
ref: ${{ inputs.tag }}
197-
198-
- name: downcase CONTAINER_IMAGE
199-
run: |
200-
echo "CONTAINER_IMAGE=${CONTAINER_IMAGE,,}" >> ${GITHUB_ENV}
201-
202-
- name: Set up Docker Buildx
203-
uses: docker/setup-buildx-action@v3
204-
205-
- name: Log in to the Container registry
206-
uses: docker/login-action@v3
207-
with:
208-
registry: ghcr.io
209-
username: ${{ github.actor }}
210-
password: ${{ secrets.GITHUB_TOKEN }}
211-
212-
- name: Build and push
213-
uses: docker/build-push-action@v5
214-
id: build_container
215-
with:
216-
context: .
217-
file: ./libs/labelbox/Dockerfile
218-
github-token: ${{ secrets.GITHUB_TOKEN }}
219-
push: true
220-
221-
platforms: |
222-
linux/amd64
223-
linux/arm64
224-
225-
tags: |
226-
${{ env.CONTAINER_IMAGE }}:latest
227-
${{ env.CONTAINER_IMAGE }}:${{ inputs.tag }}
228-
- name: Output image
229-
id: image
230-
run: |
231-
# NOTE: Set the image as an output because the `env` context is not
232-
# available to the inputs of a reusable workflow call.
233-
image_name="${CONTAINER_IMAGE}"
234-
echo "image=$image_name" >> "$GITHUB_OUTPUT"
235-
236-
provenance_container:
237-
needs: [container-publish]
238-
permissions:
239-
actions: read # for detecting the Github Actions environment.
240-
id-token: write # for creating OIDC tokens for signing.
241-
packages: write # for uploading attestations.
242-
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@v2.0.0
243-
with:
244-
image: ${{ needs. container-publish.outputs.image }}
245-
digest: ${{ needs. container-publish.outputs.digest }}
246-
registry-username: ${{ github.actor }}
247-
secrets:
248-
registry-password: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Labelbox Python SDK Publish PROD Test
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
tag:
7+
description: 'Release Tag'
8+
required: true
9+
skip-tests:
10+
description: 'Skip PROD Test (Do not do this unless there is an emergency)'
11+
default: false
12+
type: boolean
13+
14+
15+
concurrency:
16+
group: ${{ github.workflow }}
17+
cancel-in-progress: false
18+
19+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
20+
permissions:
21+
contents: read
22+
pages: write
23+
id-token: write
24+
25+
jobs:
26+
build:
27+
runs-on: ubuntu-latest
28+
outputs:
29+
hashes: ${{ steps.hash.outputs.hashes }}
30+
steps:
31+
- uses: actions/checkout@v4
32+
with:
33+
ref: ${{ inputs.tag }}
34+
- name: Install the latest version of rye
35+
uses: eifinger/setup-rye@v2
36+
with:
37+
version: ${{ vars.RYE_VERSION }}
38+
enable-cache: true
39+
- name: Rye Setup
40+
run: |
41+
rye config --set-bool behavior.use-uv=true
42+
- name: Create build
43+
working-directory: libs/labelbox
44+
run: |
45+
rye sync
46+
rye build
47+
- name: "Generate hashes"
48+
id: hash
49+
run: |
50+
cd dist && echo "hashes=$(sha256sum * | base64 -w0)" >> $GITHUB_OUTPUT
51+
- uses: actions/upload-artifact@v4
52+
with:
53+
name: build
54+
path: ./dist

0 commit comments

Comments
 (0)