-
Notifications
You must be signed in to change notification settings - Fork 8
81 lines (75 loc) · 2.14 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
name: Upload Python Package and Build Image
on:
release:
types: [published]
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine hatch
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Upload dists to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/*
file_glob: true
tag: ${{ github.ref }}
overwrite: true
# Build docker images
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push image
id: docker_build
uses: docker/build-push-action@v4
with:
context: .
build-args: |
BCC_VERSION=v0.28.0
DUETECTOR_VERSION=${{ github.ref_name }}
platforms: linux/amd64,linux/arm64/v8
file: ./docker/Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/duetector:${{ github.ref_name }}
# Build latest if release
-
name: Build and push release
if: '!github.event.release.prerelease'
id: docker_build_release
uses: docker/build-push-action@v4
with:
context: .
build-args: |
BCC_VERSION=v0.28.0
DUETECTOR_VERSION=${{ github.ref_name }}
platforms: linux/amd64,linux/arm64/v8
file: ./docker/Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/duetector:latest