Skip to content

Commit 5fed252

Browse files
committed
Update build process to sync with pve-ve-dockerfiles
1 parent 76e96de commit 5fed252

35 files changed

+980
-466
lines changed
Lines changed: 74 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,137 @@
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
87+
env:
88+
ARCH: ${{ matrix.arch }}
6789
steps:
6890
- name: Checkout
6991
uses: actions/checkout@v3
7092
- name: Set up QEMU
7193
uses: docker/setup-qemu-action@v2
94+
95+
# Compile the client
7296
- name: Run client for ${{matrix.docker_arch}}
73-
run: make ${{matrix.docker_arch}}-client
74-
- name: Upload artifacts
75-
run: make github-upload-all
76-
env:
77-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
97+
run: ./release.bash "${{ env.REGISTRY }}:${{ env.TAG }}" client-tgz
98+
99+
# Upload files to draft release
100+
- name: Upload files to draft release
101+
uses: ncipollo/release-action@v1
102+
with:
103+
tag: ${{ env.TAG }}
104+
artifacts: release/*.tgz
105+
allowUpdates: true
106+
updateOnlyUnreleased: true
107+
omitBodyDuringUpdate: true
108+
omitNameDuringUpdate: true
109+
omitDraftDuringUpdate: true
78110

79111
prerelease:
80112
runs-on: ubuntu-latest
81113
needs: [client-build, docker-build]
82114
steps:
83115
- name: Checkout
84116
uses: actions/checkout@v3
117+
118+
# Update docker manifest
85119
- name: Login to Docker Hub
86120
uses: docker/login-action@v3
87121
with:
88122
username: ${{ secrets.DOCKERHUB_USERNAME }}
89123
password: ${{ secrets.DOCKERHUB_TOKEN }}
90-
- name: Run dockerhub-manifest
91-
run: make dockerhub-manifest
92-
- name: Run github-create-pre-release
93-
run: make github-create-pre-release
94-
env:
95-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
124+
- name: Create manifest
125+
run:
126+
./release.bash "${{ env.REGISTRY }}:${{ env.TAG }}" manifest
127+
128+
# Create pre-release
129+
- name: Make release as pre-release
130+
uses: ncipollo/release-action@v1
131+
with:
132+
tag: ${{ env.TAG }}
133+
prerelease: true
134+
allowUpdates: true
135+
updateOnlyUnreleased: true
136+
omitBodyDuringUpdate: true
137+
omitNameDuringUpdate: true

.github/workflows/build_test.yaml

Lines changed: 67 additions & 16 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
@@ -41,8 +35,16 @@ jobs:
4135
else
4236
echo "TAG=ref-${{ github.ref_name }}" >> $GITHUB_ENV;
4337
fi
44-
- name: Run docker-build for ${{matrix.docker_arch}}
45-
run: make ${{matrix.docker_arch}}-docker-build
38+
- name: Run docker for ${{matrix.docker_arch}}
39+
env:
40+
TAG: ${{ env.TAG }}
41+
run: ./release.bash "${{ env.REGISTRY }}:${{ env.TAG }}" build-image build-deb
42+
43+
# Push Artifacts to GitHub
44+
- uses: actions/upload-artifact@v4
45+
with:
46+
name: server-${{ matrix.docker_arch }}
47+
path: release/
4648

4749
# Push to DockerHub
4850
- name: Login to Docker Hub
@@ -53,7 +55,7 @@ jobs:
5355
password: ${{ secrets.DOCKERHUB_TEST_TOKEN }}
5456
- name: Run dockerhub for ${{matrix.docker_arch}}
5557
if: vars.DOCKERHUB_TEST_REGISTRY
56-
run: make ${{matrix.docker_arch}}-dockerhub
58+
run: ./release.bash "${{ env.REGISTRY }}:${{ env.TAG }}" push-image
5759

5860
client-build:
5961
runs-on: ${{ matrix.runs_on }}
@@ -62,13 +64,62 @@ jobs:
6264
matrix:
6365
include:
6466
- runs_on: ubuntu-24.04-arm
65-
docker_arch: arm64v8
67+
arch: arm64
6668
- runs_on: ubuntu-24.04
67-
docker_arch: amd64
69+
arch: amd64
70+
env:
71+
ARCH: ${{ matrix.arch }}
6872
steps:
6973
- name: Checkout
7074
uses: actions/checkout@v3
7175
- name: Set up QEMU
7276
uses: docker/setup-qemu-action@v2
77+
# Compile the client
7378
- name: Run client for ${{matrix.docker_arch}}
74-
run: make ${{matrix.docker_arch}}-client
79+
run: ./release.bash "${{ env.REGISTRY }}:${{ env.TAG }}" client-tgz
80+
# Push Artifacts to GitHub
81+
- uses: actions/upload-artifact@v4
82+
with:
83+
name: client-${{ matrix.docker_arch }}
84+
path: release/
85+
86+
manifest:
87+
runs-on: ubuntu-latest
88+
needs: [client-build, docker-build]
89+
steps:
90+
- name: Checkout
91+
uses: actions/checkout@v3
92+
- name: Set repository name
93+
if: vars.DOCKERHUB_TEST_REGISTRY
94+
run:
95+
echo "REGISTRY=${{ vars.DOCKERHUB_TEST_REGISTRY }}" >> $GITHUB_ENV;
96+
if [[ -n "${{ github.event.pull_request.number }}" ]]; then
97+
echo "TAG=github-pr-${{ github.event.pull_request.number }}" >> $GITHUB_ENV;
98+
else
99+
echo "TAG=ref-${{ github.ref_name }}" >> $GITHUB_ENV;
100+
fi
101+
- name: Login to Docker Hub
102+
if: vars.DOCKERHUB_TEST_REGISTRY
103+
uses: docker/login-action@v3
104+
with:
105+
username: ${{ secrets.DOCKERHUB_TEST_USERNAME }}
106+
password: ${{ secrets.DOCKERHUB_TEST_TOKEN }}
107+
- name: Run dockerhub-manifest
108+
run: ./release.bash "${{ env.REGISTRY }}:${{ env.TAG }}"
109+
- name: Comment image name on PR
110+
if: github.event_name == 'pull_request'
111+
env:
112+
REGISTRY: ${{ env.REGISTRY }}
113+
TAG: ${{ env.TAG }}
114+
uses: actions/github-script@v7
115+
with:
116+
script: |
117+
const imageName = `${{ env.REGISTRY }}:${{ env.TAG }}`;
118+
const body = `✅ Docker image pushed: \`${imageName}\``;
119+
120+
await github.rest.issues.createComment({
121+
owner: context.repo.owner,
122+
repo: context.repo.repo,
123+
issue_number: context.issue.number,
124+
body: body
125+
});

.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)