-
Notifications
You must be signed in to change notification settings - Fork 0
128 lines (107 loc) · 4.26 KB
/
release.yml
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
name: 🚀 Release
on:
push:
tags: ["*"]
permissions:
contents: write
packages: write
env:
REGISTRY: ghcr.io
IMAGE_NAME: sedaprotocol/seda-data-proxy
jobs:
build-and-push-amd64:
name: 🐳 Build and Push Docker Image (amd64)
runs-on: ubuntu-latest
steps:
- name: 📥 Checkout code
uses: actions/checkout@v4
- name: 🔐 Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: 🏗️ Build and push Docker image for amd64
run: |
docker build \
--build-arg TARGET_ARCH=bun-linux-x64-modern \
-t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}-bun-linux-x64-modern \
-f .build/docker/Dockerfile \
.
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}-bun-linux-x64-modern
build-and-push-arm64:
name: 🐳 Build and Push Docker Image (arm64)
runs-on: ubuntu-latest
steps:
- name: 📥 Checkout code
uses: actions/checkout@v4
- name: 🛠️ Set up QEMU for ARM64
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- name: 🔐 Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: 🏗️ Build and push Docker image for arm64
run: |
docker build \
--platform linux/arm64 \
--build-arg TARGET_ARCH=bun-linux-arm64 \
-t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}-bun-linux-arm64 \
-f .build/docker/Dockerfile \
.
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}-bun-linux-arm64
create-manifest:
name: 📝 Create and Push Docker Manifest
needs:
- build-and-push-amd64
- build-and-push-arm64
runs-on: ubuntu-latest
steps:
- name: 🔐 Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: 📝 Create and Push Manifest
run: |
docker manifest create ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }} \
--amend ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}-bun-linux-x64-modern \
--amend ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}-bun-linux-arm64
docker manifest push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}
create-release:
name: 📦 Create GitHub Release
needs: create-manifest
runs-on: ubuntu-latest
steps:
- name: 📥 Checkout code
uses: actions/checkout@v4
- name: 📝 Generate Changelog
id: changelog
uses: TriPSs/conventional-changelog-action@v5.3.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
output-file: false
skip-commit: true
skip-tag: true
skip-git-pull: true
git-push: false
- name: 🎉 Create GitHub Release
uses: ncipollo/release-action@v1
with:
allowUpdates: true
generateReleaseNotes: true
tag: ${{ github.ref_name }}
name: ${{ github.ref_name }}
body: |
${{ steps.changelog.outputs.changelog }}
## Docker Images
The following Docker images were built and published to GHCR:
- [ghcr.io/sedaprotocol/seda-data-proxy:${{ github.ref_name }}-bun-linux-x64-modern](https://ghcr.io/sedaprotocol/seda-data-proxy:${{ github.ref_name }}-bun-linux-x64-modern)
- [ghcr.io/sedaprotocol/seda-data-proxy:${{ github.ref_name }}-bun-linux-arm64](https://ghcr.io/sedaprotocol/seda-data-proxy:${{ github.ref_name }}-bun-linux-arm64)
- [ghcr.io/sedaprotocol/seda-data-proxy:${{ github.ref_name }}](https://ghcr.io/sedaprotocol/seda-data-proxy:${{ github.ref_name }})
token: ${{ secrets.GITHUB_TOKEN }}