1919 - synchronize
2020 - reopened
2121
22+ # Manual trigger for custom builds and releases
23+ workflow_dispatch :
24+ inputs :
25+ criu_version :
26+ description : ' CRIU version to build (e.g., 4.1)'
27+ required : false
28+ type : string
29+ criu_commit :
30+ description : ' CRIU commit/tag to build (overrides version if set)'
31+ required : false
32+ type : string
33+ criu_shasum :
34+ description : ' SHA256 checksum for the CRIU source'
35+ required : true
36+ type : string
37+ build_revision :
38+ description : ' Build revision suffix (e.g., r1, r2) for build script changes'
39+ required : false
40+ type : string
41+ release_type :
42+ description : ' Release type'
43+ required : false
44+ type : choice
45+ default : ' draft'
46+ options :
47+ - ' none'
48+ - ' draft'
49+ - ' release'
50+
2251# avoid running multiple copies of the same workflow in parallel
2352concurrency :
2453 group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
3867 uses : docker/setup-buildx-action@v3.10.0
3968
4069 - name : Build criu
70+ if : github.event_name != 'workflow_dispatch'
4171 uses : docker/build-push-action@v6
4272 with :
4373 context : .
5080 cache-from : type=gha,scope=criu-build-image-amd64
5181 cache-to : type=gha,mode=max,scope=criu-build-image-amd64
5282
83+ - name : Build criu
84+ if : github.event_name == 'workflow_dispatch'
85+ uses : docker/build-push-action@v6
86+ with :
87+ context : .
88+ outputs : type=local,dest=./output
89+ file : Dockerfile
90+ push : false
91+ load : true
92+ tags : " criu-build-image-amd64"
93+ platforms : " linux/amd64"
94+ cache-from : type=gha,scope=criu-build-image-amd64
95+ cache-to : type=gha,mode=max,scope=criu-build-image-amd64
96+ build-args : |
97+ CRIU_VERSION=${{ inputs.criu_version }}
98+ CRIU_COMMIT=${{ inputs.criu_commit }}
99+ CRIU_SHASUM=${{ inputs.criu_shasum }}
100+
53101 - name : Upload amd64 artifact
54102 uses : actions/upload-artifact@v4.6.2
55103 with :
@@ -69,6 +117,21 @@ jobs:
69117 uses : docker/setup-buildx-action@v3.10.0
70118
71119 - name : Build criu
120+ if : github.event_name != 'workflow_dispatch'
121+ uses : docker/build-push-action@v6
122+ with :
123+ context : .
124+ outputs : type=local,dest=./output
125+ file : Dockerfile
126+ push : false
127+ load : true
128+ tags : " criu-build-image-arm64"
129+ platforms : " linux/arm64"
130+ cache-from : type=gha,scope=criu-build-image-arm64
131+ cache-to : type=gha,mode=max,scope=criu-build-image-arm64
132+
133+ - name : Build criu
134+ if : github.event_name == 'workflow_dispatch'
72135 uses : docker/build-push-action@v6
73136 with :
74137 context : .
@@ -80,6 +143,10 @@ jobs:
80143 platforms : " linux/arm64"
81144 cache-from : type=gha,scope=criu-build-image-arm64
82145 cache-to : type=gha,mode=max,scope=criu-build-image-arm64
146+ build-args : |
147+ CRIU_VERSION=${{ inputs.criu_version }}
148+ CRIU_COMMIT=${{ inputs.criu_commit }}
149+ CRIU_SHASUM=${{ inputs.criu_shasum }}
83150
84151 - name : Upload arm64 artifact
85152 uses : actions/upload-artifact@v4.6.2
89156
90157 release :
91158 name : Release
92- if : " contains(github.event.head_commit.message, '[release]') && ( github.event.ref=='refs/heads/master' || contains(github.event.ref, 'release') ) "
159+ if : " inputs.release_type != 'none' "
93160 needs : [build-amd64, build-arm64]
94161 runs-on : ubuntu-24.04
95162 permissions :
@@ -103,7 +170,7 @@ jobs:
103170 with :
104171 pattern : criu-amd64
105172 path : dist
106-
173+
107174 - name : Download build artifacts (arm64)
108175 uses : actions/download-artifact@v4.3.0
109176 with :
@@ -115,10 +182,23 @@ jobs:
115182 with :
116183 java-version : 11
117184
118- - name : Version
185+ - name : Determine version
119186 id : version
120187 run : |
121- VERSION=$(cmake --preset static-release -LA | grep CRIU_VERSION | cut -d'=' -f2)
188+ if [ -n "${{ inputs.criu_commit }}" ]; then
189+ BASE_VERSION="${{ inputs.criu_commit }}"
190+ elif [ -n "${{ inputs.criu_version }}" ]; then
191+ BASE_VERSION="${{ inputs.criu_version }}"
192+ else
193+ BASE_VERSION=$(cmake --preset static-release -LA | grep CRIU_VERSION | cut -d'=' -f2)
194+ fi
195+
196+ if [ -n "${{ inputs.build_revision }}" ]; then
197+ VERSION="${BASE_VERSION}-${{ inputs.build_revision }}"
198+ else
199+ VERSION="${BASE_VERSION}"
200+ fi
201+
122202 echo "VERSION = $VERSION"
123203 echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"
124204
@@ -127,3 +207,4 @@ jobs:
127207 env :
128208 JRELEASER_GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
129209 JRELEASER_PROJECT_VERSION : ${{ steps.version.outputs.VERSION }}
210+ JRELEASER_DRAFT : ${{ inputs.release_type == 'draft' }}
0 commit comments