Skip to content

obs

obs #1520

Workflow file for this run

name: obs
on:
pull_request:
workflow_dispatch:
inputs:
revision:
default: main
description: Branch or Tag to be published
type: string
skip-bundles:
default: false
description: Skip bundling and only stage+test+release
type: boolean
skip-stage:
default: false
description: Skip staging and only bundles+test+release
type: boolean
skip-tests:
default: false
description: Skip testing and only bundles+stage+release
type: boolean
skip-release:
default: false
description: Skip releasing and only bundles+stage+test
type: boolean
env:
REVISION: ${{ inputs.revision || 'main' }}
OBS_PASSWORD: ${{ secrets.OBS_PASSWORD }}
jobs:
vars:
runs-on: ubuntu-latest
timeout-minutes: 300
outputs:
archive_path: ${{ steps.step.outputs.ARCHIVE_PATH }}
commit: ${{ steps.step.outputs.COMMIT }}
git_root: ${{ steps.step.outputs.GIT_ROOT }}
project: ${{ steps.step.outputs.PROJECT }}
project_type: ${{ steps.step.outputs.PROJECT_TYPE }}
project_version: ${{ steps.step.outputs.PROJECT_VERSION }}
version: ${{ steps.step.outputs.VERSION }}
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- id: step
run: |
source scripts/vars
echo "ARCHIVE_PATH=$ARCHIVE_PATH" >> "$GITHUB_OUTPUT"
echo "COMMIT=$COMMIT" >> "$GITHUB_OUTPUT"
echo "GIT_ROOT=$GIT_ROOT" >> "$GITHUB_OUTPUT"
echo "PROJECT=$PROJECT" >> "$GITHUB_OUTPUT"
echo "PROJECT_TYPE=$PROJECT_TYPE" >> "$GITHUB_OUTPUT"
echo "PROJECT_VERSION=$PROJECT_VERSION" >> "$GITHUB_OUTPUT"
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"
- run: scripts/github-job-wait
if: ${{ github.event_name != 'pull_request' }}
env:
COMMIT: ${{ steps.step.outputs.commit }}
GH_TOKEN: ${{ github.token }}
- name: COMMIT=${{ steps.step.outputs.commit }}
run: true
bundles:
runs-on: ubuntu-latest
needs: vars
strategy:
fail-fast: false
matrix:
arch:
- amd64
- arm64
- ppc64le
- s390x
name: bundle / build / ${{ inputs.revision || 'main' }} / ${{ matrix.arch }}
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: sigstore/cosign-installer@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20 # v3.5.0
- run: scripts/bundle/build
if: ${{ inputs.skip-bundles == false }}
env:
ARCH: ${{ matrix.arch }}
ARCHIVE_PATH: ${{ needs.vars.outputs.archive_path }}
COMMIT: ${{ needs.vars.outputs.commit }}
GIT_ROOT: ${{ needs.vars.outputs.git_root }}
PROJECT: ${{ needs.vars.outputs.project }}
PROJECT_TYPE: ${{ needs.vars.outputs.project_type }}
PROJECT_VERSION: ${{ needs.vars.outputs.project_version }}
VERSION: ${{ needs.vars.outputs.version }}
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
if: ${{ inputs.skip-bundles == false }}
with:
name: bundles-${{ matrix.arch }}
path: build/bundle/*.tar.gz*
bundle-test:
name: bundle / test / ${{ inputs.revision || 'main' }} / amd64
runs-on: ubuntu-latest
needs:
- vars
- bundles
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
if: ${{ inputs.skip-bundles == false }}
with:
name: bundles-amd64
path: build/bundle
- run: sudo -E scripts/bundle/test
if: ${{ inputs.skip-bundles == false }}
env:
ARCHIVE_PATH: ${{ needs.vars.outputs.archive_path }}
COMMIT: ${{ needs.vars.outputs.commit }}
GIT_ROOT: ${{ needs.vars.outputs.git_root }}
PROJECT: ${{ needs.vars.outputs.project }}
PROJECT_TYPE: ${{ needs.vars.outputs.project_type }}
PROJECT_VERSION: ${{ needs.vars.outputs.project_version }}
VERSION: ${{ needs.vars.outputs.version }}
bundles-publish:
name: bundles / publish / ${{ inputs.revision || 'main' }}
runs-on: ubuntu-latest
needs: bundle-test
permissions:
id-token: write
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: google-github-actions/auth@71fee32a0bb7e97b4d33d548e7d957010649d8fa # v2.1.3
if: ${{ inputs.skip-bundles == false && github.event_name != 'pull_request' }}
with:
credentials_json: ${{ secrets.GCS_CRIO_SA }}
- uses: sigstore/cosign-installer@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20 # v3.5.0
if: ${{ inputs.skip-bundles == false && github.event_name != 'pull_request' }}
- uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
if: ${{ inputs.skip-bundles == false && github.event_name != 'pull_request' }}
with:
name: bundles-amd64
path: build/bundle
- uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
if: ${{ inputs.skip-bundles == false && github.event_name != 'pull_request' }}
with:
name: bundles-arm64
path: build/bundle
- uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
if: ${{ inputs.skip-bundles == false && github.event_name != 'pull_request' }}
with:
name: bundles-ppc64le
path: build/bundle
- uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
if: ${{ inputs.skip-bundles == false && github.event_name != 'pull_request' }}
with:
name: bundles-s390x
path: build/bundle
- run: scripts/sign-artifacts
if: ${{ inputs.skip-bundles == false && github.event_name != 'pull_request' }}
- uses: google-github-actions/upload-cloud-storage@22121cd842b0d185e042e28d969925b538c33d77 # v2.1.0
if: ${{ inputs.skip-bundles == false && github.event_name != 'pull_request' }}
with:
path: build/bundle
destination: cri-o/artifacts
parent: false
process_gcloudignore: false
- name: Create bundle marker
if: ${{ inputs.skip-bundles == false && github.event_name != 'pull_request' }}
run: find . -type f -iname "cri-o.amd64.*.tar.gz" | sed -n 's;.*amd64.\(.*\).tar.gz;\1;p' > latest-bundle-${{ inputs.revision || 'main' }}.txt
- name: Upload bundle marker
uses: google-github-actions/upload-cloud-storage@22121cd842b0d185e042e28d969925b538c33d77 # v2.1.0
if: ${{ inputs.skip-bundles == false && github.event_name != 'pull_request' }}
with:
path: latest-bundle-${{ inputs.revision || 'main' }}.txt
destination: cri-o
process_gcloudignore: false
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
if: ${{ inputs.skip-bundles == false && github.event_name != 'pull_request' }}
with:
name: signatures
path: |
build/bundle/*.sig
build/bundle/*.cert
stage:
runs-on: ubuntu-latest
name: stage / ${{ inputs.revision || 'main' }}
timeout-minutes: 240
needs:
- vars
- bundles-publish
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- run: scripts/obs
if: ${{ inputs.skip-stage == false && github.event_name != 'pull_request' }}
env:
ARCHIVE_PATH: ${{ needs.vars.outputs.archive_path }}
COMMIT: ${{ needs.vars.outputs.commit }}
GIT_ROOT: ${{ needs.vars.outputs.git_root }}
PROJECT: ${{ needs.vars.outputs.project }}
PROJECT_TYPE: ${{ needs.vars.outputs.project_type }}
PROJECT_VERSION: ${{ needs.vars.outputs.project_version }}
VERSION: ${{ needs.vars.outputs.version }}
test-kubernetes:
runs-on: ubuntu-latest
timeout-minutes: 120
needs:
- vars
- stage
strategy:
fail-fast: false
matrix:
type:
- deb
- rpm
name: test / ${{ matrix.type }} / kubernetes / amd64
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- run: sudo scripts/github-actions-setup
if: ${{ inputs.skip-tests == false }}
- run: sudo -E scripts/test-kubernetes
if: ${{ inputs.skip-tests == false }}
env:
TYPE: ${{ matrix.type }}
ARCHIVE_PATH: ${{ needs.vars.outputs.archive_path }}
COMMIT: ${{ needs.vars.outputs.commit }}
GIT_ROOT: ${{ needs.vars.outputs.git_root }}
PROJECT: ${{ needs.vars.outputs.project }}
PROJECT_TYPE: ${{ needs.vars.outputs.project_type }}
PROJECT_VERSION: ${{ needs.vars.outputs.project_version }}
VERSION: ${{ needs.vars.outputs.version }}
test-architectures:
runs-on: ubuntu-latest
timeout-minutes: 120
needs:
- vars
- stage
strategy:
fail-fast: false
matrix:
run:
- image: almalinux:9.2
type: rpm
- image: fedora:38
type: rpm
- image: debian:12
type: deb
- image: ubuntu:22.04
type: deb
arch:
- amd64
- arm64
- ppc64le
- s390x
exclude:
- run:
image: fedora:38
arch: arm64 # takes forever
name: test / ${{ matrix.run.type }} / ${{ matrix.run.image }} / ${{ matrix.arch }}
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.0.0
- run: scripts/test-architectures
if: ${{ inputs.skip-tests == false }}
env:
IMAGE: ${{ matrix.run.image }}
ARCH: ${{ matrix.arch }}
TYPE: ${{ matrix.run.type }}
ARCHIVE_PATH: ${{ needs.vars.outputs.archive_path }}
COMMIT: ${{ needs.vars.outputs.commit }}
GIT_ROOT: ${{ needs.vars.outputs.git_root }}
PROJECT: ${{ needs.vars.outputs.project }}
PROJECT_TYPE: ${{ needs.vars.outputs.project_type }}
PROJECT_VERSION: ${{ needs.vars.outputs.project_version }}
VERSION: ${{ needs.vars.outputs.version }}
release:
runs-on: ubuntu-latest
name: release / ${{ inputs.revision || 'main' }}
needs:
- vars
- test-architectures
- test-kubernetes
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- run: scripts/obs
if: ${{ inputs.skip-release == false && github.event_name != 'pull_request' }}
env:
RUN_RELEASE: 1
ARCHIVE_PATH: ${{ needs.vars.outputs.archive_path }}
COMMIT: ${{ needs.vars.outputs.commit }}
GIT_ROOT: ${{ needs.vars.outputs.git_root }}
PROJECT: ${{ needs.vars.outputs.project }}
PROJECT_TYPE: ${{ needs.vars.outputs.project_type }}
PROJECT_VERSION: ${{ needs.vars.outputs.project_version }}
VERSION: ${{ needs.vars.outputs.version }}