-
-
Notifications
You must be signed in to change notification settings - Fork 64
143 lines (123 loc) · 3.9 KB
/
release.yml
File metadata and controls
143 lines (123 loc) · 3.9 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
133
134
135
136
137
138
139
140
141
142
143
name: Release
on:
push:
tags:
- '*.*.*'
jobs:
release_test:
name: Release Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
# NOTE: Test full matrix before release
include:
- os: ubuntu-latest
arch: amd64
- os: ubuntu-latest
arch: arm64
- os: macos-15
arch: amd64
- os: macos-15
arch: arm64
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Run install
run: make install
- name: Run lint
run: uv run make lint
- name: Run tests
run: uv run make test
env:
ALCHEMY_API_KEY: ${{ secrets.ALCHEMY_API_KEY }}
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
ONFINALITY_API_KEY: ${{ secrets.ONFINALITY_API_KEY }}
release:
name: Release
needs: release_test
runs-on: ubuntu-24.04
env:
DOCKER_REGISTRY: ghcr.io
DOCKER_IMAGE_NAME: ${{ github.repository }}
steps:
- name: Check out the repo
uses: actions/checkout@v4
# NOTE: Fetch full history for Sentry release
with:
fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
install: true
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: |
dipdup/dipdup
${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }}
flavor: |
latest=false
tags: |
type=pep440,pattern={{version}}
type=pep440,pattern={{major}}
type=pep440,pattern={{major}}.{{minor}}
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Run install
run: make install
- name: Publish stable image
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Publish package on PyPi
run: uv build && uv publish --token ${{secrets.PYPI_TOKEN}}
# FIXME: Fails on prereleases; https://github.com/mindsers/changelog-reader-action/pull/39
- 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: false
prerelease: ${{ steps.changelog.outputs.status == 'prereleased' }}
- name: Create Sentry release
uses: getsentry/action-release@v1
with:
version: ${{ steps.changelog.outputs.version }}
ignore_missing: true
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: sentry
SENTRY_PROJECT: dipdup
SENTRY_URL: ${{ secrets.SENTRY_URL }}