Skip to content

Commit d368eda

Browse files
committed
add manual trigger
1 parent 6c4d17c commit d368eda

File tree

1 file changed

+63
-24
lines changed

1 file changed

+63
-24
lines changed

.github/workflows/release.yml

Lines changed: 63 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,82 @@
11
name: Release
22

3-
on:
4-
push:
5-
tags:
6-
# run only against tags that follow semver (https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string)
7-
- 'v[0-9]+.[0-9]+.[0-9]+*'
8-
- 'v[0-9]+.[0-9]+.[0-9]+*.[0-9]+'
3+
on: push
4+
5+
concurrency:
6+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
7+
cancel-in-progress: true
98

109
permissions:
1110
contents: write
11+
packages: write
12+
13+
env:
14+
REGISTRY: ghcr.io
15+
REGISTRY_IMAGE: ghcr.io/0xpolygon/cdk-validium-node
16+
IMAGE_TAG: v0.6.4+cdk.9
1217

1318
jobs:
14-
goreleaser:
19+
build:
1520
runs-on: ubuntu-latest
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
platform:
25+
- linux/amd64
26+
- linux/arm64
1627
steps:
28+
- name: Prepare
29+
run: |
30+
platform=${{ matrix.platform }}
31+
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
32+
1733
- name: Checkout
1834
uses: actions/checkout@v4
19-
with:
20-
fetch-depth: 0
21-
22-
- name: Set up Go
23-
uses: actions/setup-go@v5
24-
with:
25-
go-version: 1.23.7
2635

2736
- name: Set up QEMU
2837
uses: docker/setup-qemu-action@v3
2938

30-
- name: Login to DockerHub
39+
- name: Set up Docker Buildx
40+
uses: docker/setup-buildx-action@v3
41+
42+
- name: Login to GitHub Container Registry
3143
uses: docker/login-action@v3
3244
with:
33-
username: ${{ secrets.DOCKERHUB_USERNAME }}
34-
password: ${{ secrets.DOCKERHUB_TOKEN }}
45+
registry: ${{ env.REGISTRY }}
46+
username: ${{ github.actor }}
47+
password: ${{ secrets.GITHUB_TOKEN }}
3548

36-
- name: Run GoReleaser
37-
uses: goreleaser/goreleaser-action@v5
49+
- name: Build and push image
50+
uses: docker/build-push-action@v6
3851
with:
39-
distribution: goreleaser
40-
version: latest
41-
args: release --clean --config=.goreleaser-cdk.yaml
42-
env:
43-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+
context: .
53+
push: true
54+
platforms: ${{ matrix.platform }}
55+
tags: ${{ env.REGISTRY_IMAGE }}:${{ env.IMAGE_TAG }}
56+
cache-from: type=gha
57+
cache-to: type=gha,mode=max
58+
59+
merge:
60+
runs-on: ubuntu-latest
61+
needs:
62+
- build
63+
steps:
64+
- name: Set up Docker Buildx
65+
uses: docker/setup-buildx-action@v3
66+
67+
- name: Login to GitHub Container Registry
68+
uses: docker/login-action@v3
69+
with:
70+
registry: ${{ env.REGISTRY }}
71+
username: ${{ github.actor }}
72+
password: ${{ secrets.GITHUB_TOKEN }}
73+
74+
- name: Create and push manifest
75+
run: |
76+
docker buildx imagetools create -t ${{ env.REGISTRY_IMAGE }}:${{ env.IMAGE_TAG }} \
77+
${{ env.REGISTRY_IMAGE }}:${{ env.IMAGE_TAG }}-linux-amd64 \
78+
${{ env.REGISTRY_IMAGE }}:${{ env.IMAGE_TAG }}-linux-arm64
79+
80+
- name: Inspect image
81+
run: |
82+
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ env.IMAGE_TAG }}

0 commit comments

Comments
 (0)