-
Notifications
You must be signed in to change notification settings - Fork 0
133 lines (127 loc) · 3.74 KB
/
cli-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
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: Reliably CLI Release
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
jobs:
checks:
uses: ./.github/workflows/cli-check.yaml
publish-wheels:
name: Publish wheels
environment: release
permissions:
id-token: write
runs-on: ubuntu-22.04
needs:
- checks
steps:
- uses: actions/checkout@v3
- name: Set up PDM
uses: pdm-project/setup-pdm@v3
with:
python-version: "3.11"
- name: Build wheels
run: pdm build --no-sdist
- name: Publish wheels
uses: pypa/gh-action-pypi-publish@release/v1
build-container:
name: Build containers
runs-on: ubuntu-22.04
needs:
- publish-wheels
steps:
- uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: meta for the container image
id: meta
uses: docker/metadata-action@v4
with:
flavor: |
prefix=
images: |
ghcr.io/reliablyhq/cli/cli
tags: |
type=sha,prefix=,format=long
type=raw,value=latest
- name: Build and push Container
uses: docker/build-push-action@v4
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
platforms: linux/amd64
file: ./Dockerfile
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-full-container:
name: Build full containers with extensions
runs-on: ubuntu-22.04
needs:
- publish-wheels
steps:
- uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: meta for the container image
id: meta
uses: docker/metadata-action@v4
with:
flavor: |
prefix=
images: |
ghcr.io/reliablyhq/cli/full
tags: |
type=sha,prefix=,format=long
type=raw,value=latest
- name: Build and push Container
uses: docker/build-push-action@v4
with:
context: ./container
push: ${{ github.event_name != 'pull_request' }}
platforms: linux/amd64
file: ./Dockerfile
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
release:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs:
- build-container
- build-full-container
steps:
- name: Build Changelog
id: github_release
uses: mikepenz/release-changelog-builder-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
configurationJson: |
{
"template": "#{{CHANGELOG}}\n\n<details>\n<summary>Uncategorized</summary>\n\n#{{UNCATEGORIZED}}\n</details>",
"categories": [
{
"title": "## 💬 Other",
"labels": ["other"]
},
{
"title": "## 📦 Dependencies",
"labels": ["dependencies"]
}
]
}
- name: Create Release
uses: softprops/action-gh-release@v1
with:
body: ${{steps.github_release.outputs.changelog}}