-
Notifications
You must be signed in to change notification settings - Fork 40
133 lines (121 loc) · 3.75 KB
/
cd.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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: Release
on:
workflow_dispatch:
inputs:
version:
description: "The release version."
required: true
default: "v2.x.x"
jobs:
build-distribution:
name: Build distribution 📦
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install pypa/build
run: python3 -m pip install build --user
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/
publish-to-pypi:
name: Publish to PyPI 🚀
timeout-minutes: 5
needs:
- build-distribution
runs-on: ubuntu-latest
environment:
name: release
url: https://pypi.org/p/viadot2
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true
publish-docker-images:
name: Publish Docker images 🐳
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log into GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Construct the tag for Docker images
run: |
# Strip the "v" prefix for the image tag.
VERSION=${{ github.event.inputs.version }}
echo "TAG=${VERSION#v}" >> $GITHUB_ENV
- name: Build and publish viadot-lite image
uses: docker/build-push-action@v6
with:
context: .
file: docker/Dockerfile
platforms: linux/amd64
push: true
target: viadot-lite
tags: |
ghcr.io/${{ github.repository }}/viadot-lite:${{ env.TAG }}
ghcr.io/${{ github.repository }}/viadot-lite:latest
- name: Build and publish viadot-aws image
uses: docker/build-push-action@v6
with:
context: .
file: docker/Dockerfile
platforms: linux/amd64
push: true
target: viadot-aws
tags: |
ghcr.io/${{ github.repository }}/viadot-aws:${{ env.TAG }}
ghcr.io/${{ github.repository }}/viadot-aws:latest
- name: Build and publish viadot-azure image
uses: docker/build-push-action@v6
with:
context: .
file: docker/Dockerfile
platforms: linux/amd64
push: true
target: viadot-azure
tags: |
ghcr.io/${{ github.repository }}/viadot-azure:${{ env.TAG }}
ghcr.io/${{ github.repository }}/viadot-azure:latest
build-args: INSTALL_DATABRICKS=false
create_github_release:
name: Create a GitHub release 🔖
timeout-minutes: 5
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Create a release
uses: ncipollo/release-action@v1
with:
generateReleaseNotes: true
tag: ${{ github.event.inputs.version }}