Skip to content

Commit b5bdc95

Browse files
MatMaulmcalinghee
authored andcommitted
Tweak CI for Tchap
1 parent 98f2776 commit b5bdc95

File tree

1 file changed

+70
-7
lines changed

1 file changed

+70
-7
lines changed

.github/workflows/build.yaml

Lines changed: 70 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Build
33
on:
44
push:
55
branches:
6-
- main
6+
- tchap
77
- "release/**"
88
tags:
99
- "v*"
@@ -22,8 +22,9 @@ env:
2222
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
2323
SCCACHE_GHA_ENABLED: "true"
2424
RUSTC_WRAPPER: "sccache"
25-
IMAGE: ghcr.io/element-hq/matrix-authentication-service
26-
BUILDCACHE: ghcr.io/element-hq/matrix-authentication-service/buildcache
25+
IMAGE: ghcr.io/tchapgouv/matrix-authentication-service
26+
IMAGE_SYN2MAS: ghcr.io/tchapgouv/matrix-authentication-service/syn2mas
27+
BUILDCACHE: ghcr.io/tchapgouv/matrix-authentication-service/buildcache
2728
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index
2829

2930
jobs:
@@ -252,8 +253,24 @@ jobs:
252253
type=semver,pattern={{major}}
253254
type=sha
254255
256+
- name: Docker meta (syn2mas)
257+
id: meta-syn2mas
258+
uses: docker/[email protected]
259+
with:
260+
images: "${{ env.IMAGE_SYN2MAS }}"
261+
bake-target: docker-metadata-action-syn2mas
262+
flavor: |
263+
latest=auto
264+
tags: |
265+
type=ref,event=branch
266+
type=ref,event=pr
267+
type=semver,pattern={{version}}
268+
type=semver,pattern={{major}}.{{minor}}
269+
type=semver,pattern={{major}}
270+
type=sha
271+
255272
- name: Setup Cosign
256-
uses: sigstore/[email protected].2
273+
uses: sigstore/[email protected].1
257274

258275
- name: Set up Docker Buildx
259276
uses: docker/[email protected]
@@ -271,12 +288,13 @@ jobs:
271288

272289
- name: Build and push
273290
id: bake
274-
uses: docker/bake-action@v6.6.0
291+
uses: docker/bake-action@v6.5.0
275292
with:
276293
files: |
277294
./docker-bake.hcl
278295
cwd://${{ steps.meta.outputs.bake-file }}
279296
cwd://${{ steps.meta-debug.outputs.bake-file }}
297+
cwd://${{ steps.meta-syn2mas.outputs.bake-file }}
280298
set: |
281299
base.output=type=image,push=true
282300
base.cache-from=type=registry,ref=${{ env.BUILDCACHE }}:buildcache
@@ -295,16 +313,48 @@ jobs:
295313
# Only sign on tags and on commits on main branch
296314
if: |
297315
github.event_name != 'pull_request'
298-
&& (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
316+
&& (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/tchap')
299317
300318
env:
301319
REGULAR_DIGEST: ${{ steps.output.outputs.metadata && fromJSON(steps.output.outputs.metadata).regular.digest }}
302320
DEBUG_DIGEST: ${{ steps.output.outputs.metadata && fromJSON(steps.output.outputs.metadata).debug.digest }}
321+
SYN2MAS_DIGEST: ${{ steps.output.outputs.metadata && fromJSON(steps.output.outputs.metadata).syn2mas.digest }}
303322

304323
run: |-
305324
cosign sign --yes \
306325
"$IMAGE@$REGULAR_DIGEST" \
307326
"$IMAGE@$DEBUG_DIGEST" \
327+
"$IMAGE_SYN2MAS@$SYN2MAS_DIGEST"
328+
329+
syn2mas:
330+
name: Release syn2mas on NPM
331+
runs-on: ubuntu-24.04
332+
if: 'false'
333+
334+
permissions:
335+
contents: read
336+
id-token: write
337+
338+
steps:
339+
- name: Checkout the code
340+
uses: actions/[email protected]
341+
342+
- name: Install Node
343+
uses: actions/[email protected]
344+
with:
345+
node-version-file: ./tools/syn2mas/.nvmrc
346+
347+
- name: Install Node dependencies
348+
working-directory: ./tools/syn2mas
349+
run: npm ci
350+
351+
- name: Publish
352+
uses: JS-DevTools/npm-publish@v3
353+
with:
354+
package: ./tools/syn2mas
355+
token: ${{ secrets.NPM_TOKEN }}
356+
provenance: true
357+
dry-run: ${{ !startsWith(github.ref, 'refs/tags/') }}
308358

309359
release:
310360
name: Release
@@ -313,6 +363,7 @@ jobs:
313363
needs:
314364
- assemble-archives
315365
- build-image
366+
- syn2mas
316367
steps:
317368
- name: Download the artifacts from the previous job
318369
uses: actions/download-artifact@v4
@@ -352,14 +403,26 @@ jobs:
352403
') }}
353404
```
354405
406+
`syn2mas` migration tool:
407+
408+
- Digest:
409+
```
410+
${{ env.IMAGE_SYN2MAS }}@${{ fromJSON(needs.build-image.outputs.metadata).syn2mas.digest }}
411+
```
412+
- Tags:
413+
```
414+
${{ join(fromJSON(needs.build-image.outputs.metadata).syn2mas.tags, '
415+
') }}
416+
```
417+
355418
files: |
356419
artifacts/mas-cli-aarch64-linux.tar.gz
357420
artifacts/mas-cli-x86_64-linux.tar.gz
358421
draft: true
359422

360423
unstable:
361424
name: Update the unstable release
362-
if: github.ref == 'refs/heads/main'
425+
if: github.ref == 'refs/heads/tchap'
363426
runs-on: ubuntu-24.04
364427

365428
needs:

0 commit comments

Comments
 (0)