Skip to content

Commit 4eae229

Browse files
authored
Workflow to publish experimental MicroShift builds on COPR (#208)
1 parent b54eaf3 commit 4eae229

5 files changed

Lines changed: 77 additions & 15 deletions

File tree

.github/workflows/nightly-copr.yaml renamed to .github/workflows/copr-build-and-test.yaml

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,34 @@
1-
name: nightly-copr
1+
name: copr-build-test
22

33
on:
4-
schedule:
5-
- cron: "0 1 * * *"
6-
workflow_dispatch:
4+
workflow_call:
75
inputs:
6+
ushift-git-url:
7+
description: "MicroShift git repository URL"
8+
type: string
9+
default: "https://github.com/openshift/microshift.git"
10+
ushift-gitref:
11+
description: "MicroShift git ref (branch or tag)"
12+
type: string
13+
default: "main"
814
copr-repo-name:
9-
description: COPR repository name
10-
default: "@microshift-io/microshift-nightly"
15+
description: "COPR repository name"
16+
type: string
17+
required: true
18+
bootc-image-tag:
19+
description: "Bootc base image tag"
1120
type: string
21+
default: "stream10"
22+
23+
secrets:
24+
COPR_CONFIG:
25+
required: true
1226

1327
env:
14-
COPR_REPO_NAME: ${{ github.event.inputs.copr-repo-name || '@microshift-io/microshift-nightly' }}
28+
COPR_REPO_NAME: ${{ inputs.copr-repo-name }}
1529

1630
jobs:
1731
build-dependencies-rpm:
18-
if: github.event_name != 'schedule' || github.repository == 'microshift-io/microshift'
1932
runs-on: ubuntu-24.04
2033
steps:
2134
- name: Check out MicroShift upstream repository
@@ -56,7 +69,6 @@ jobs:
5669
5770
5871
build-rpms:
59-
if: github.event_name != 'schedule' || github.repository == 'microshift-io/microshift'
6072
runs-on: ubuntu-24.04
6173
steps:
6274
- name: Check out MicroShift upstream repository
@@ -71,7 +83,8 @@ jobs:
7183
run: |
7284
cd ${GITHUB_WORKSPACE}/
7385
make srpm \
74-
USHIFT_GITREF=main \
86+
USHIFT_GIT_URL="${{ inputs.ushift-git-url }}" \
87+
USHIFT_GITREF="${{ inputs.ushift-gitref }}" \
7588
OKD_VERSION_TAG=${{ steps.detect-okd-version.outputs.okd-version-tag }} \
7689
SRPM_WORKDIR=/mnt/srpm
7790
@@ -122,7 +135,6 @@ jobs:
122135

123136
build-and-test-microshift:
124137
needs: build-rpms
125-
if: github.event_name != 'schedule' || github.repository == 'microshift-io/microshift'
126138
strategy:
127139
matrix:
128140
runners: [ubuntu-24.04, ubuntu-24.04-arm]
@@ -161,7 +173,7 @@ jobs:
161173
ushift-gitref: nil # RPMs are not built, so no need for git ref or OKD version
162174
okd-version-tag: nil
163175
bootc-image-url: quay.io/centos-bootc/centos-bootc
164-
bootc-image-tag: stream10
176+
bootc-image-tag: ${{ inputs.bootc-image-tag }}
165177
skip-prebuild: "true"
166178
build: bootc-image
167179

@@ -177,7 +189,6 @@ jobs:
177189

178190
regenerate-copr-repo:
179191
needs: build-and-test-microshift
180-
if: github.event_name != 'schedule' || github.repository == 'microshift-io/microshift'
181192
runs-on: ubuntu-24.04
182193
steps:
183194
- name: Check out MicroShift upstream repository
@@ -188,7 +199,7 @@ jobs:
188199
env:
189200
COPR_CONFIG: |
190201
${{ secrets.COPR_CONFIG }}
191-
run : |
202+
run: |
192203
echo "${COPR_CONFIG}" > /tmp/copr-config
193204
make copr-regenerate-repos \
194205
COPR_CONFIG=/tmp/copr-config \
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: experimental-copr
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
fork-repo:
7+
description: "Fork repository (e.g., pmtk/microshift)"
8+
required: true
9+
type: string
10+
branch:
11+
description: "Branch name to build"
12+
required: true
13+
type: string
14+
copr-repo:
15+
description: "COPR repository name (e.g., @microshift-io/experimental-c2cc)"
16+
required: true
17+
type: string
18+
19+
jobs:
20+
copr-pipeline:
21+
uses: ./.github/workflows/copr-build-and-test.yaml
22+
with:
23+
ushift-git-url: "https://github.com/${{ inputs.fork-repo }}.git"
24+
ushift-gitref: ${{ inputs.branch }}
25+
copr-repo-name: ${{ inputs.copr-repo }}
26+
bootc-image-tag: stream9
27+
secrets:
28+
COPR_CONFIG: ${{ secrets.COPR_CONFIG }}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: nightly-copr
2+
3+
on:
4+
schedule:
5+
- cron: "0 1 * * *"
6+
workflow_dispatch:
7+
inputs:
8+
copr-repo-name:
9+
description: COPR repository name
10+
default: "@microshift-io/microshift-nightly"
11+
type: string
12+
13+
jobs:
14+
copr-pipeline:
15+
if: github.event_name != 'schedule' || github.repository == 'microshift-io/microshift'
16+
uses: ./.github/workflows/copr-build-and-test.yaml
17+
with:
18+
copr-repo-name: ${{ github.event.inputs.copr-repo-name || '@microshift-io/microshift-nightly' }}
19+
bootc-image-tag: stream10
20+
secrets:
21+
COPR_CONFIG: ${{ secrets.COPR_CONFIG }}

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
ARCH := $(shell uname -m)
66

77
# Options used in the 'rpm' target
8+
USHIFT_GIT_URL ?= https://github.com/openshift/microshift.git
89
USHIFT_GITREF ?= main
910
ifeq ($(ARCH),aarch64)
1011
OKD_VERSION_TAG ?= $$(./src/okd/get_version.sh latest-arm64)
@@ -87,6 +88,7 @@ srpm:
8788
@echo "Building the MicroShift SRPM image"
8889
sudo podman build \
8990
-t "${SRPM_IMAGE}" \
91+
--build-arg USHIFT_GIT_URL="${USHIFT_GIT_URL}" \
9092
--build-arg USHIFT_GITREF="${USHIFT_GITREF}" \
9193
--build-arg OKD_VERSION_TAG="${OKD_VERSION_TAG}" \
9294
--build-arg OKD_RELEASE_IMAGE_X86_64="${OKD_RELEASE_IMAGE_X86_64}" \

src/copr/microshift-io-dependencies.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Release: 1%{?dist}
5555
Summary: RPM repository configurations for MicroShift dependencies
5656
5757
License: Apache-2.0
58-
URL: https://github.com/microshift-io/microshift-io
58+
URL: https://github.com/microshift-io/microshift
5959
BuildArch: noarch
6060
6161
%description

0 commit comments

Comments
 (0)