-
Notifications
You must be signed in to change notification settings - Fork 3
178 lines (153 loc) · 5.55 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
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
name: release conductor
on:
push:
branches:
- master
pull_request:
release:
types: [created]
jobs:
dockerize:
name: dockerize
runs-on: ubuntu-22.04
steps:
- name: checkout
uses: actions/checkout@v4
- name: configure eqemu
uses: docker/setup-qemu-action@v3
with:
platforms: "linux/arm64,linux/amd64"
- name: configure docker buildx
uses: docker/setup-buildx-action@v3
- name: login to docker registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: build docker images
timeout-minutes: 20
id: docker-bake
uses: docker/bake-action@v4
env:
DOCKER_REGISTRY: ghcr.io/${{ github.repository }}/
COMMIT_SHA: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
PUBLISH_VERSION: ${{ github.event_name == 'release' && github.event.release.tag_name || '' }}
PUBLISH_LATEST: ${{ github.event_name == 'release' && !github.event.release.prerelease && '1' || '' }}
with:
workdir: .
provenance: false
push: true
files: ./bin/conductor/docker/bake.hcl
targets: build
set: |
*.cache-from=type=gha,scope=build
*.cache-to=type=gha,scope=build,mode=max
- name: docker details pr comment
uses: marocchino/sticky-pull-request-comment@v2
if: ${{ github.event_name == 'pull_request' }}
with:
message: |
🐋 This PR was built and pushed to the following [Docker images](https://github.com/the-guild-org/conductor/pkgs/container/conductor%2Fconductor):
<details>
<summary>Docker Bake metadata</summary>
```json
${{ steps.docker-bake.outputs.metadata }}
```
</details>
- name: update release body
uses: softprops/action-gh-release@v2
if: ${{ github.event_name == 'release' }}
with:
append_body: true
body: |
🐋 This release is available as Docker image, using the following Docker tag:
```
ghcr.io/the-guild-org/conductor/conductor:${{ github.event.release.tag_name }}
```
wasm:
name: compile wasm (cloudflare-worker)
runs-on: ubuntu-22.04
steps:
- name: checkout
uses: actions/checkout@v4
- name: setup environment
uses: ./.github/actions/setup
- name: "build (bin: cloudflare_worker_wasm)"
working-directory: bin/cloudflare_worker
run: cargo install -q worker-build && worker-build --release
- uses: actions/upload-artifact@v4
if: ${{ github.event_name == 'pull_request' || github.event_name == 'push' }}
name: upload wasm artifact
with:
name: conductor-cf-worker-wasm
path: bin/cloudflare_worker/build/
- uses: montudor/action-zip@v1
name: zip wasm artifact
if: ${{ github.event_name == 'release' }}
with:
args: zip -qq -r cloudflare-worker-wasm.zip bin/cloudflare_worker/build/
- name: upload wasm to release
if: ${{ github.event_name == 'release' }}
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: cloudflare-worker-wasm.zip
asset_name: cloudflare-worker-wasm
tag: ${{ github.ref }}
overwrite: true
config-schema:
name: config-schema
runs-on: ubuntu-22.04
steps:
- name: checkout
uses: actions/checkout@v4
- uses: actions/upload-artifact@v4
if: ${{ github.event_name == 'pull_request' || github.event_name == 'push' }}
name: upload artifact
with:
name: conductor.schema.json
path: libs/config/conductor.schema.json
- name: upload to release
if: ${{ github.event_name == 'release' }}
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: libs/config/conductor.schema.json
asset_name: conductor.schema.json
tag: ${{ github.ref }}
overwrite: true
binary:
name: compile binary (${{ matrix.platform.target }})
strategy:
matrix:
platform:
- os: ubuntu-22.04
target: x86_64-unknown-linux-gnu
- os: ubuntu-22.04
target: aarch64-unknown-linux-gnu
runs-on: ${{ matrix.platform.os }}
steps:
- name: checkout
uses: actions/checkout@v4
- name: build binary
uses: houseabsolute/actions-rust-cross@v0
with:
command: build
target: ${{ matrix.platform.target }}
args: "--locked --release"
- uses: actions/upload-artifact@v4
if: ${{ github.event_name == 'pull_request' || github.event_name == 'push' }}
name: upload binary artifact
with:
name: conductor-${{ matrix.platform.target }}
path: target/${{ matrix.platform.target }}/release/conductor
- name: upload binaries to release
if: ${{ github.event_name == 'release' }}
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/${{ matrix.platform.target }}/release/conductor
asset_name: conductor-${{ matrix.platform.target }}
tag: ${{ github.ref }}
overwrite: true