-
Notifications
You must be signed in to change notification settings - Fork 2
61 lines (56 loc) · 1.69 KB
/
release.yaml
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
name: Release Toolkit
on:
push:
branches:
- release
env:
PYTHON_VERSION: '3.11'
jobs:
release-pypi:
runs-on: ubuntu-latest
environment: CD
# This causes issues when CDF is down.
#needs: [lint, test, build]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- uses: snok/install-poetry@v1
with:
version: 1.6.1
virtualenvs-create: false
- name: Install dependencies
run: poetry install
- name: Build package
run: poetry build
- name: Release to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: twine upload --verbose dist/*
release-to-docker-hub:
runs-on: ubuntu-latest
environment: CD
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- id: version
name: Toolkit Version
# Read the version from the cognite_toolkit/_version.py file
run: echo "version=$(sed -n 's/^__version__ = "\(.*\)"/\1/p' cognite_toolkit/_version.py)" >> $GITHUB_ENV
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64/v8
push: true
tags: cognite/toolkit:${{ env.version }}, cognite/toolkit:latest