-
Notifications
You must be signed in to change notification settings - Fork 25
118 lines (98 loc) · 3.16 KB
/
publish.yml
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
106
107
108
109
110
111
112
113
114
115
116
117
118
name: Publish
on:
release:
types: [published]
concurrency:
group: encord-active-${{ github.ref }}-publish
cancel-in-progress: true
jobs:
frontend-build:
name: Build frontend
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
token: ${{ secrets.AUTOMATION_BOT_ACCESS_TOKEN }}
ref: main
- name: Build
uses: ./.github/actions/build-frontend
with:
secrets: ${{ toJSON(secrets) }}
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: frontend-build-${{ github.sha }}
path: src/encord_active/frontend/dist
if-no-files-found: error
publish:
needs: [frontend-build]
name: Build and publish Encord Active
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
token: ${{ secrets.AUTOMATION_BOT_ACCESS_TOKEN }}
ref: main
- name: Download frontend build
uses: actions/download-artifact@v3
with:
name: frontend-build-${{ github.sha }}
path: src/encord_active/frontend/dist
- name: Setup root poetry environment
uses: ./.github/actions/setup-root-poetry-environment
- name: Poetry Version Bump
run: "poetry version ${{ github.ref_name }}"
- name: Module Version Bump
run: 'sed -i "s/__version__ = \".*\"/__version__ = \"${{ github.ref_name }}\"/g" src/encord_active/__init__.py'
- name: Version Bump commit
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "Version bump to ${{ github.ref_name }}"
push_options: --force
- name: Build
run: poetry build
- name: Publish
run: |
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
poetry publish
docker:
needs: [publish]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: main
- name: Download frontend build
uses: actions/download-artifact@v3
with:
name: frontend-build-${{ github.sha }}
path: src/encord_active/frontend/dist
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
${{ secrets.DOCKERHUB_USERNAME }}/encord-active
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/encord-active:latest
cache-to: type=inline