-
Notifications
You must be signed in to change notification settings - Fork 1
132 lines (115 loc) · 4.13 KB
/
ci.yml
File metadata and controls
132 lines (115 loc) · 4.13 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: flight-sql-websocket-proxy-ci
on:
push:
workflow_dispatch:
release:
types:
- published
env:
DOCKER_IMAGE_NAME: gizmodata/flight-sql-websocket-proxy
jobs:
get-package-version:
runs-on: ubuntu-latest
name: Get Package Version from GitHub ref
outputs:
PACKAGE_VERSION: ${{ steps.extract_ref.outputs.package_version }}
steps:
- id: extract_ref
name: Extract GitHub ref_name
run: |
CLEAN_REF=$(echo "${{ github.ref_name }}" | tr '/' '-')
echo "package_version=${CLEAN_REF}" >> $GITHUB_OUTPUT
- name: Log package version
run: |
echo "PACKAGE_VERSION=${{ steps.extract_ref.outputs.package_version }}"
docker:
name: Build and publish Docker image to Github Container Registry
needs: get-package-version
strategy:
matrix:
include:
- platform: amd64
runner: ubuntu-latest
- platform: arm64
runner: buildjet-4vcpu-ubuntu-2204-arm
runs-on: ${{ matrix.runner }}
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub (for image pulls)
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build and push the Docker image
uses: docker/build-push-action@v6
with:
platforms: linux/${{ matrix.platform }}
push: true
tags: |
${{ env.DOCKER_IMAGE_NAME }}:${{ needs.get-package-version.outputs.PACKAGE_VERSION }}-${{ matrix.platform }}
no-cache: true
provenance: false
update-image-manifest:
name: Update DockerHub image manifest to include all built platforms
needs: [docker, get-package-version]
runs-on: ubuntu-latest
steps:
- name: Login to Docker Hub (for image pulls)
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Create and push manifest images - package version
uses: Noelware/docker-manifest-action@0.4.3
with:
inputs: ${{ env.DOCKER_IMAGE_NAME }}:${{ needs.get-package-version.outputs.PACKAGE_VERSION }}
images: ${{ env.DOCKER_IMAGE_NAME }}:${{ needs.get-package-version.outputs.PACKAGE_VERSION }}-amd64,${{ env.DOCKER_IMAGE_NAME }}:${{ needs.get-package-version.outputs.PACKAGE_VERSION }}-arm64
push: true
- name: Create and push manifest images - latest
uses: Noelware/docker-manifest-action@0.4.3
if: startsWith(github.ref, 'refs/tags/')
with:
inputs: ${{ env.DOCKER_IMAGE_NAME }}:latest
images: ${{ env.DOCKER_IMAGE_NAME }}:${{ needs.get-package-version.outputs.PACKAGE_VERSION }}-amd64,${{ env.DOCKER_IMAGE_NAME }}:${{ needs.get-package-version.outputs.PACKAGE_VERSION }}-arm64
push: true
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI
runs-on: ubuntu-latest
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing to PyPi
contents: write # Grant write access for creating releases
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
./dist/*.whl
LICENSE
README.md