-
Notifications
You must be signed in to change notification settings - Fork 13
COPR #107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
COPR #107
Changes from all commits
f33f365
d8df822
36a3b53
85de5d6
56f65c4
281a30b
588b51d
407cebd
88d659e
097d667
de12928
ed41b0c
54bdd01
248efdb
d3efc92
3e2e44a
c96855d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,17 +9,13 @@ on: | |
| description: MicroShift branch from https://github.com/openshift/microshift/branches | ||
| type: string | ||
| okd-version-tag: | ||
| default: "4.19.0-okd-scos.19" | ||
| default: "4.21.0-okd-scos.ec.5" | ||
| description: OKD version tag from https://quay.io/repository/okd/scos-release?tab=tags | ||
| type: string | ||
| build: | ||
| type: choice | ||
| description: Types of artifacts to build | ||
| default: all | ||
| options: | ||
| - all | ||
| - rpms | ||
| - bootc-image | ||
| copr-repo: | ||
| default: pmtk0/test123 | ||
| description: COPR repository name | ||
| type: string | ||
|
Comment on lines
+15
to
+18
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't default to a personal COPR repo. Leaving 🤖 Prompt for AI Agents |
||
|
|
||
| jobs: | ||
| build: | ||
|
|
@@ -34,47 +30,56 @@ jobs: | |
| - name: Check out MicroShift upstream repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Run the build action | ||
| - name: Prepare the build and run environment | ||
| uses: ./.github/actions/prebuild | ||
|
|
||
| - name: Build MicroShift RPMs | ||
| shell: bash | ||
| env: | ||
| COPR_TOKEN: | | ||
| ${{ secrets.COPR_TOKEN }} | ||
| run: | | ||
| cd ${GITHUB_WORKSPACE}/ | ||
| echo "${COPR_TOKEN}" > /tmp/copr-token | ||
| make copr-rpm \ | ||
| USHIFT_BRANCH=${{ inputs.ushift-branch }} \ | ||
| OKD_VERSION_TAG=${{ inputs.okd-version-tag }} \ | ||
| RPM_OUTDIR=/mnt/rpms \ | ||
| COPR_CONFIG=/tmp/copr-token \ | ||
| COPR_REPO_NAME="${{ inputs.copr-repo }}" | ||
|
|
||
| - name: Build and test bootc image | ||
| uses: ./.github/actions/build | ||
| with: | ||
| ushift-branch: ${{ inputs.ushift-branch }} | ||
| okd-version-tag: ${{ inputs.okd-version-tag }} | ||
| build: ${{ inputs.build }} | ||
|
|
||
| # Test the local container image with the quick start and clean procedures | ||
| # before releasing the artifacts. | ||
| - name: Run the quick start script and clean scripts | ||
| if: contains(fromJSON('["all", "bootc-image"]'), inputs.build) | ||
| uses: ./.github/actions/quick-start-clean | ||
| with: | ||
| image-ref: localhost/microshift-okd:latest | ||
| build: bootc-image | ||
| rpm-builder: rpm-copr-builder | ||
|
|
||
| # The release process consumes the RPMs and the container image | ||
| # prepared by the build action. | ||
| - name: Prepare the RPM archives | ||
| if: contains(fromJSON('["all", "rpms"]'), inputs.build) | ||
| - name: COPR - Delete builds | ||
| if: failure() | ||
| shell: bash | ||
| env: | ||
| COPR_TOKEN: | | ||
| ${{ secrets.COPR_TOKEN }} | ||
| run : | | ||
| # Archive sources separately from the RPMs | ||
| sudo mv /mnt/rpms/srpms /mnt/srpms | ||
| cd /mnt/srpms | ||
| sudo tar zcvf /mnt/release/microshift-src.tgz . | ||
|
|
||
| cd /mnt/rpms | ||
| sudo tar zcvf /mnt/release/microshift-rpms-$(uname -m).tgz . | ||
| echo "${COPR_TOKEN}" > /tmp/copr-token | ||
| make copr-delete-builds \ | ||
| COPR_CONFIG=/tmp/copr-token \ | ||
| COPR_BUILDS="$(cat /mnt/rpms/builds.txt)" | ||
|
|
||
| - name: Release RPMs | ||
| if: contains(fromJSON('["all", "rpms"]'), inputs.build) | ||
| uses: softprops/action-gh-release@v2 | ||
| with: | ||
| tag_name: ${{ inputs.ushift-branch }}-${{ inputs.okd-version-tag }} | ||
| files: | | ||
| /mnt/release/microshift-rpms-*.tgz | ||
| /mnt/release/microshift-src.tgz | ||
| overwrite_files: true | ||
| - name: COPR - Regenerate RPM repo | ||
| shell: bash | ||
| env: | ||
| COPR_TOKEN: | | ||
| ${{ secrets.COPR_TOKEN }} | ||
| run : | | ||
| echo "${COPR_TOKEN}" > /tmp/copr-token | ||
| make copr-regenerate-repos \ | ||
| COPR_CONFIG=/tmp/copr-token \ | ||
| COPR_REPO_NAME="${{ inputs.copr-repo }}" | ||
|
|
||
| - name: Login to GitHub Container Registry | ||
| if: contains(fromJSON('["all", "bootc-image"]'), inputs.build) | ||
| uses: redhat-actions/podman-login@v1 | ||
| with: | ||
| registry: ghcr.io/${{ github.repository_owner }} | ||
|
|
@@ -83,21 +88,24 @@ jobs: | |
| auth_file_path: /tmp/ghcr-auth.json | ||
|
|
||
| - name: Publish Bootc image | ||
| if: contains(fromJSON('["all", "bootc-image"]'), inputs.build) | ||
| id: publish-bootc-image | ||
| shell: bash | ||
| run: | | ||
| VERSION="$(cat /mnt/rpms/version.txt)" | ||
| sudo podman tag microshift-okd \ | ||
| ghcr.io/${{ github.repository }}:${{ inputs.ushift-branch }}-${{ inputs.okd-version-tag }} \ | ||
| ghcr.io/${{ github.repository }}:${VERSION} \ | ||
| ghcr.io/${{ github.repository }}:latest | ||
| sudo podman push --authfile /tmp/ghcr-auth.json ghcr.io/${{ github.repository }}:${{ inputs.ushift-branch }}-${{ inputs.okd-version-tag }} | ||
| sudo podman push --authfile /tmp/ghcr-auth.json ghcr.io/${{ github.repository }}:${VERSION} | ||
| sudo podman push --authfile /tmp/ghcr-auth.json ghcr.io/${{ github.repository }}:latest | ||
|
|
||
| # Prepare the release note for the bootc image usage | ||
| TAG=${{ inputs.ushift-branch }}-${{ inputs.okd-version-tag }} envsubst < .github/workflows/release.md > /tmp/release.md | ||
| VERSION="${VERSION}" \ | ||
| COPR_REPO_NAME="${{ inputs.copr-repo }}" \ | ||
| envsubst < .github/workflows/release.md > /tmp/release.md | ||
| echo "version=${VERSION}" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Add release note for bootc image usage | ||
| if: contains(fromJSON('["all", "bootc-image"]'), inputs.build) | ||
| uses: softprops/action-gh-release@v2 | ||
| with: | ||
| tag_name: ${{ inputs.ushift-branch }}-${{ inputs.okd-version-tag }} | ||
| tag_name: ${{ steps.publish-bootc-image.outputs.version }} | ||
| body_path: /tmp/release.md | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clarify where
$VERSIONand$COPR_REPO_NAMEvariables are defined.The documentation uses
$VERSIONand$COPR_REPO_NAMEvariables without explaining where they come from or how users should set them. Consider adding a note at the beginning explaining these are placeholders that should be replaced with actual values (e.g.,export VERSION=4.18.0andexport COPR_REPO_NAME=microshift-io/microshift).🤖 Prompt for AI Agents