forked from voxel51/fiftyone
-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (93 loc) · 2.92 KB
/
publish.yml
File metadata and controls
105 lines (93 loc) · 2.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: Publish
on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+
- v[0-9]+.[0-9]+.[0-9]+rc[0-9]+
jobs:
build:
uses: ./.github/workflows/build.yml
e2e:
uses: ./.github/workflows/e2e.yml
test:
uses: ./.github/workflows/test.yml
publish:
runs-on: ubuntu-latest
needs: [build, test]
environment: release # For trusted publishing. See below.
permissions:
contents: read
id-token: write
steps:
- name: Download dist
uses: actions/download-artifact@v7
with:
name: dist
path: dist/
# Utilize
# [trusted publishers](https://docs.pypi.org/trusted-publishers/)
# This will use OIDC to publish the dists/ package to pypi.
# See
# [fiftyone](https://pypi.org/manage/project/fiftyone/settings/publishing)
- name: Publish
uses: pypa/[email protected]
publish-docker-images:
needs: [publish]
runs-on: ubuntu-latest
strategy:
matrix:
python:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
steps:
- name: Clone fiftyone
uses: actions/checkout@v6
- name: Set Env Vars
run: |
echo "today=$(date +%Y%m%d)" >> "$GITHUB_ENV"
ref_name=${{ github.ref_name }}
echo "fo_version=${ref_name#v}" >> "$GITHUB_ENV"
echo "pyver=${{ matrix.python }}" >> "$GITHUB_ENV"
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.RW_DOCKERHUB_USER }}
password: ${{ secrets.RW_DOCKERHUB_PAT }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push (except latest)
if: matrix.python != '3.11'
uses: docker/build-push-action@v6
with:
build-args: |
BUILD_TYPE=released
FO_VERSION=${{ env.fo_version }}
PYTHON_VERSION=${{ env.pyver }}
context: .
platforms: linux/amd64,linux/arm64
push: true
sbom: true
tags: |
voxel51/fiftyone:${{ env.fo_version }}-python${{ env.pyver }}
voxel51/fiftyone:${{ env.fo_version }}-python${{ env.pyver }}-${{ env.today }}
- name: Build and push (latest)
if: matrix.python == '3.11'
uses: docker/build-push-action@v6
with:
build-args: |
BUILD_TYPE=released
FO_VERSION=${{ env.fo_version }}
PYTHON_VERSION=${{ env.pyver }}
context: .
platforms: linux/amd64,linux/arm64
push: true
sbom: true
tags: |
voxel51/fiftyone:${{ env.fo_version }}
voxel51/fiftyone:${{ env.fo_version }}-python${{ env.pyver }}
voxel51/fiftyone:${{ env.fo_version }}-python${{ env.pyver }}-${{ env.today }}
voxel51/fiftyone:latest