-
-
Notifications
You must be signed in to change notification settings - Fork 57
153 lines (134 loc) · 4.33 KB
/
release.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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
name: Release
on:
push:
tags:
- '*.*.*'
jobs:
release:
name: Release
runs-on: ubuntu-22.04
steps:
- name: Check out the repo
uses: actions/checkout@v3
# NOTE: Fetch full history for Sentry release
with:
fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
install: true
- name: Log in to the registry
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Set up metadata (default)
id: meta-default
uses: docker/metadata-action@v3
with:
images: dipdup/dipdup
flavor: |
latest=false
tags: |
type=pep440,pattern={{version}}
type=pep440,pattern={{major}}
type=pep440,pattern={{major}}.{{minor}}
- name: Set up metadata (pytezos)
id: meta-pytezos
uses: docker/metadata-action@v3
with:
images: dipdup/dipdup
flavor: |
latest=false
tags: |
type=pep440,pattern={{version}}-pytezos
type=pep440,pattern={{major}}-pytezos
type=pep440,pattern={{major}}.{{minor}}-pytezos
- name: Set up metadata (slim)
id: meta-slim
uses: docker/metadata-action@v3
with:
images: dipdup/dipdup
flavor: |
latest=false
tags: |
type=pep440,pattern={{version}}-slim
type=pep440,pattern={{major}}-slim
type=pep440,pattern={{major}}.{{minor}}-slim
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Set up Poetry
uses: snok/install-poetry@v1
with:
version: '1.4.0'
- name: Install project
run: make install
- name: Run lint
run: make lint
- name: Run tests
run: make test
- name: Publish stable image (default)
uses: docker/build-push-action@v3
with:
context: .
file: Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta-default.outputs.tags }}
labels: ${{ steps.meta-default.outputs.labels }}
build-args: DIPDUP_DOCKER_IMAGE=default
- name: Publish stable image (pytezos)
uses: docker/build-push-action@v3
with:
context: .
file: Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta-pytezos.outputs.tags }}
labels: ${{ steps.meta-pytezos.outputs.labels }}
build-args: DIPDUP_DOCKER_IMAGE=pytezos
- name: Publish stable image (slim)
uses: docker/build-push-action@v3
with:
context: .
file: Dockerfile.slim
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta-slim.outputs.tags }}
labels: ${{ steps.meta-slim.outputs.labels }}
- name: Publish package on PyPi
run: |
poetry config http-basic.pypi __token__ ${{secrets.PYPI_TOKEN}}
poetry build
poetry publish
- name: Parse changelog
id: changelog
uses: mindsers/changelog-reader-action@v2
with:
version: ${{ github.ref_name }}
- name: Publish GitHub release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: ${{ steps.changelog.outputs.version }}
body: |
## ${{ steps.changelog.outputs.version }} - ${{ steps.changelog.outputs.date }}
${{ steps.changelog.outputs.changes }}
draft: true
prerelease: ${{ steps.changelog.outputs.status == 'prereleased' }}
- name: Create Sentry release
uses: getsentry/action-release@v1
with:
version: ${{ steps.changelog.outputs.version }}
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: sentry
SENTRY_PROJECT: dipdup
SENTRY_URL: ${{ secrets.SENTRY_URL }}