Skip to content

Commit 3fb2654

Browse files
committed
Update build process
1 parent 1ddc81b commit 3fb2654

File tree

9 files changed

+290
-247
lines changed

9 files changed

+290
-247
lines changed
Lines changed: 75 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,98 +1,140 @@
11
on:
22
workflow_dispatch:
33
inputs:
4-
VERSION:
5-
description: 'Version to build'
6-
required: false
7-
type: string
84
TAG:
95
description: 'Tag name to use'
106
required: false
117
type: string
128

139
env:
14-
VERSION: ${{ inputs.VERSION }}
10+
REGISTRY: ${{ vars.DOCKERHUB_REGISTRY }}
1511
TAG: ${{ inputs.TAG }}
1612

1713
jobs:
14+
1815
draft:
1916
runs-on: ubuntu-latest
2017
steps:
2118
- name: Checkout
2219
uses: actions/checkout@v3
23-
- name: Run github-create-draft
24-
run: make github-create-draft
25-
env:
26-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20+
- name: Create draft release
21+
uses: ncipollo/release-action@v1
22+
with:
23+
tag: ${{ env.TAG }}
24+
name: ${{ env.TAG }}
25+
bodyFile: RELEASE.md
26+
draft: true
27+
generateReleaseNotes: true
28+
removeArtifacts: true
2729

2830
docker-build:
2931
needs: [draft]
3032
runs-on: ${{ matrix.runs_on }}
3133
strategy:
34+
fail-fast: false
3235
matrix:
3336
include:
3437
- runs_on: ubuntu-24.04-arm
35-
docker_arch: arm64v8
38+
arch: arm64
3639
- runs_on: ubuntu-24.04
37-
docker_arch: amd64
40+
arch: arm64
41+
env:
42+
ARCH: ${{ matrix.arch }}
3843
steps:
3944
- name: Checkout
4045
uses: actions/checkout@v3
4146
- name: Set up QEMU
4247
uses: docker/setup-qemu-action@v2
48+
49+
# Compile and release
50+
- name: Compile and release for ${{matrix.arch}}
51+
run:
52+
./release.bash "${{ env.REGISTRY }}:${{ env.TAG }}" build-tgz build-image
53+
54+
# Push to DockerHub
4355
- name: Login to Docker Hub
4456
uses: docker/login-action@v3
4557
with:
4658
username: ${{ secrets.DOCKERHUB_USERNAME }}
4759
password: ${{ secrets.DOCKERHUB_TOKEN }}
48-
- name: Run dockerhub for ${{matrix.docker_arch}}
49-
run: make ${{matrix.docker_arch}}-dockerhub
50-
- name: Run deb for ${{matrix.docker_arch}}
51-
run: make ${{matrix.docker_arch}}-deb
52-
- name: Upload deb files
53-
run: make github-upload-all
54-
env:
55-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60+
- name: Run docker push for ${{matrix.arch}}
61+
run:
62+
./release.bash "${{ env.REGISTRY }}:${{ env.TAG }}" push-image
63+
64+
# Upload files to draft release
65+
- name: Upload files to draft release
66+
uses: ncipollo/release-action@v1
67+
with:
68+
tag: ${{ env.TAG }}
69+
artifacts: release/*.tgz
70+
allowUpdates: true
71+
updateOnlyUnreleased: true
72+
omitBodyDuringUpdate: true
73+
omitNameDuringUpdate: true
74+
omitDraftDuringUpdate: true
5675

5776
client-build:
5877
needs: [draft]
5978
runs-on: ${{ matrix.runs_on }}
6079
strategy:
80+
fail-fast: false
6181
matrix:
6282
include:
6383
- runs_on: ubuntu-24.04-arm
64-
docker_arch: arm64v8
84+
arch: arm64
6585
- runs_on: ubuntu-24.04
66-
docker_arch: amd64
86+
arch: amd64
6787
- runs_on: ubuntu-24.04-arm
68-
docker_arch: arm32v7
88+
arch: arm32
6989
continue-on-error: true
90+
env:
91+
ARCH: ${{ matrix.arch }}
7092
steps:
7193
- name: Checkout
7294
uses: actions/checkout@v3
7395
- name: Set up QEMU
7496
uses: docker/setup-qemu-action@v2
97+
98+
# Compile the client
7599
- name: Run client for ${{matrix.docker_arch}}
76-
run: make ${{matrix.docker_arch}}-client
77-
- name: Upload artifacts
78-
run: make github-upload-all
79-
env:
80-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
100+
run: ./release.bash "${{ env.REGISTRY }}:${{ env.TAG }}" client-tgz
101+
102+
# Upload files to draft release
103+
- name: Upload files to draft release
104+
uses: ncipollo/release-action@v1
105+
with:
106+
tag: ${{ env.TAG }}
107+
artifacts: release/*.tgz
108+
allowUpdates: true
109+
updateOnlyUnreleased: true
110+
omitBodyDuringUpdate: true
111+
omitNameDuringUpdate: true
112+
omitDraftDuringUpdate: true
81113

82114
prerelease:
83115
runs-on: ubuntu-latest
84116
needs: [client-build, docker-build]
85117
steps:
86118
- name: Checkout
87119
uses: actions/checkout@v3
120+
121+
# Update docker manifest
88122
- name: Login to Docker Hub
89123
uses: docker/login-action@v3
90124
with:
91125
username: ${{ secrets.DOCKERHUB_USERNAME }}
92126
password: ${{ secrets.DOCKERHUB_TOKEN }}
93-
- name: Run dockerhub-manifest
94-
run: make dockerhub-manifest
95-
- name: Run github-create-pre-release
96-
run: make github-create-pre-release
97-
env:
98-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
127+
- name: Create manifest
128+
run:
129+
./release.bash "${{ env.REGISTRY }}:${{ env.TAG }}" manifest
130+
131+
# Create pre-release
132+
- name: Make release as pre-release
133+
uses: ncipollo/release-action@v1
134+
with:
135+
tag: ${{ env.TAG }}
136+
prerelease: true
137+
allowUpdates: true
138+
updateOnlyUnreleased: true
139+
omitBodyDuringUpdate: true
140+
omitNameDuringUpdate: true

.github/workflows/build_test.yaml

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,6 @@ on:
77
- .github/workflows/*.yaml
88
pull_request:
99
workflow_dispatch:
10-
inputs:
11-
VERSION:
12-
description: 'Version to build'
13-
required: false
14-
type: string
15-
16-
env:
17-
VERSION: ${{ inputs.VERSION }}
1810

1911
jobs:
2012
docker-build:
@@ -24,9 +16,11 @@ jobs:
2416
matrix:
2517
include:
2618
- runs_on: ubuntu-24.04-arm
27-
docker_arch: arm64v8
19+
arch: arm64
2820
- runs_on: ubuntu-24.04
29-
docker_arch: amd64
21+
arch: arm64
22+
env:
23+
ARCH: ${{ matrix.arch }}
3024
steps:
3125
- name: Checkout
3226
uses: actions/checkout@v3
@@ -44,7 +38,7 @@ jobs:
4438
- name: Run docker for ${{matrix.docker_arch}}
4539
env:
4640
TAG: ${{ env.TAG }}
47-
run: make ${{matrix.docker_arch}}-docker
41+
run: ./release.bash "${{ env.REGISTRY }}:${{ env.TAG }}" build-image build-deb
4842

4943
# Push Artifacts to GitHub
5044
- uses: actions/upload-artifact@v4
@@ -61,7 +55,7 @@ jobs:
6155
password: ${{ secrets.DOCKERHUB_TEST_TOKEN }}
6256
- name: Run dockerhub for ${{matrix.docker_arch}}
6357
if: vars.DOCKERHUB_TEST_REGISTRY
64-
run: make ${{matrix.docker_arch}}-dockerhub
58+
run: ./release.bash "${{ env.REGISTRY }}:${{ env.TAG }}" push-image
6559

6660
client-build:
6761
runs-on: ${{ matrix.runs_on }}
@@ -70,20 +64,22 @@ jobs:
7064
matrix:
7165
include:
7266
- runs_on: ubuntu-24.04-arm
73-
docker_arch: arm64v8
67+
arch: arm64
7468
- runs_on: ubuntu-24.04
75-
docker_arch: amd64
69+
arch: amd64
7670
- runs_on: ubuntu-24.04-arm
77-
docker_arch: arm32v7
71+
arch: arm32
7872
continue-on-error: true
73+
env:
74+
ARCH: ${{ matrix.arch }}
7975
steps:
8076
- name: Checkout
8177
uses: actions/checkout@v3
8278
- name: Set up QEMU
8379
uses: docker/setup-qemu-action@v2
8480
# Compile the client
8581
- name: Run client for ${{matrix.docker_arch}}
86-
run: make ${{matrix.docker_arch}}-client
82+
run: ./release.bash "${{ env.REGISTRY }}:${{ env.TAG }}" client-tgz
8783
# Push Artifacts to GitHub
8884
- uses: actions/upload-artifact@v4
8985
with:
@@ -112,7 +108,7 @@ jobs:
112108
username: ${{ secrets.DOCKERHUB_TEST_USERNAME }}
113109
password: ${{ secrets.DOCKERHUB_TEST_TOKEN }}
114110
- name: Run dockerhub-manifest
115-
run: make dockerhub-manifest
111+
run: ./release.bash "${{ env.REGISTRY }}:${{ env.TAG }}"
116112
- name: Comment image name on PR
117113
if: github.event_name == 'pull_request'
118114
env:

.github/workflows/pre_to_release.yaml renamed to .github/workflows/make_release.yaml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
type: string
88

99
env:
10+
REGISTRY: ${{ vars.DOCKERHUB_REGISTRY }}
1011
TAG: ${{ inputs.TAG }}
1112

1213
jobs:
@@ -20,7 +21,17 @@ jobs:
2021
with:
2122
username: ${{ secrets.DOCKERHUB_USERNAME }}
2223
password: ${{ secrets.DOCKERHUB_TOKEN }}
23-
- name: Run dockerhub-latest-release
24-
run: make github-latest-release
25-
env:
26-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
25+
# Update the dockerhub tags
26+
- name: Create semver manifest
27+
run: ./release.bash "${{ env.REGISTRY }}:${{ env.TAG }}" manifest-latest
28+
29+
# Create release
30+
- name: Make it latest
31+
uses: ncipollo/release-action@v1
32+
with:
33+
tag: ${{ env.TAG }}
34+
allowUpdates: true
35+
updateOnlyUnreleased: true
36+
omitBodyDuringUpdate: true
37+
omitNameDuringUpdate: true

0 commit comments

Comments
 (0)