Fedora compose trigger #1334
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Fedora compose trigger | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 4 * * *' | |
- cron: '0 16 * * *' | |
env: | |
COMPOSE_URL_rawhide: https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide | |
COMPOSE_URL_F40: https://dl.fedoraproject.org/pub/fedora/linux/development/40 | |
UPDATES_URL_F40: https://dl.fedoraproject.org/pub/fedora/linux/development/40 | |
COMPOSE_URL_F39: https://dl.fedoraproject.org/pub/fedora/linux/releases/39 | |
UPDATES_URL_F39: https://dl.fedoraproject.org/pub/fedora/linux/updates/39 | |
jobs: | |
#Disable Fedora Rawhide F41 jobs until osbuild-composer supports it | |
# check-compose: | |
# # Do not run this job on any fork repos | |
# if: github.repository == 'virt-s1/rhel-edge' | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v3 | |
# | |
# - name: Check if fedora rawhide compose is new | |
# id: check_compose_id | |
# run: | | |
# curl -s "${COMPOSE_URL_rawhide}/COMPOSE_ID" --output COMPOSE_ID | |
# COMPOSE_ID=$(cat COMPOSE_ID) | |
# TESTED_COMPOSE=( $( cat compose/compose.fedora ) ) | |
# if [[ " ${TESTED_COMPOSE[*]} " =~ "$COMPOSE_ID" ]]; then | |
# COMPOSE_ID="false" | |
# fi | |
# | |
# if [[ "$COMPOSE_ID" != "false" ]]; then | |
# gh pr list -R virt-s1/rhel-edge --state open --json title --jq '.[].title' > PR_LIST | |
# PR_LIST=$(cat PR_LIST) | |
# if [[ $PR_LIST == *"$COMPOSE_ID"* ]]; then | |
# echo "pr_running=true" >> $GITHUB_OUTPUT | |
# else | |
# echo "pr_running=false" >> $GITHUB_OUTPUT | |
# fi | |
# | |
# OSBUILD_VERSION=$(curl -s "${COMPOSE_URL_rawhide}/Everything/x86_64/os/Packages/o/" | grep -ioE ">osbuild-[0-9].*<" | tr -d "><") | |
# OSBUILD_COMPOSER_VERSION=$(curl -s "${COMPOSE_URL_rawhide}/Everything/x86_64/os/Packages/o/" | grep -ioE ">osbuild-composer-[0-9].*<" | tr -d "><") | |
# COMPOSER_CLI_VERSION=$(curl -s "${COMPOSE_URL_rawhide}/Everything/x86_64/os/Packages/w/" | grep -ioE ">weldr-client-[0-9].*<" | tr -d "><") | |
# echo "osbuild_version=$OSBUILD_VERSION" >> $GITHUB_OUTPUT | |
# echo "osbuild_composer_version=$OSBUILD_COMPOSER_VERSION" >> $GITHUB_OUTPUT | |
# echo "composer_cli_version=$COMPOSER_CLI_VERSION" >> $GITHUB_OUTPUT | |
# | |
# else | |
# echo "osbuild_version=Null" >> $GITHUB_OUTPUT | |
# echo "osbuild_composer_version=Null" >> $GITHUB_OUTPUT | |
# echo "composer_cli_version=Null" >> $GITHUB_OUTPUT | |
# fi | |
# | |
# echo "rawhide_compose=$COMPOSE_ID" >> $GITHUB_OUTPUT | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# | |
# outputs: | |
# rawhide_compose: ${{ steps.check_compose_id.outputs.rawhide_compose }} | |
# osbuild_version: ${{ steps.check_compose_id.outputs.osbuild_version }} | |
# osbuild_composer_version: ${{ steps.check_compose_id.outputs.osbuild_composer_version }} | |
# composer_cli_version: ${{ steps.check_compose_id.outputs.composer_cli_version }} | |
# pr_running: ${{ steps.check_compose_id.outputs.pr_running }} | |
# | |
# fedora-rawhide: | |
# needs: check-compose | |
# if: ${{ needs.check-compose.outputs.rawhide_compose != 'false' && needs.check-compose.outputs.pr_running == 'false' }} | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v3 | |
# | |
# - name: Add new compose id in compose.fedora | |
# run: | | |
# compose_id="${{ needs.check-compose.outputs.rawhide_compose }}" | |
# echo $compose_id >> compose/compose.fedora | |
# cat compose/compose.fedora | |
# | |
# - name: Get current date | |
# id: date | |
# run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT | |
# | |
# - name: Create Pull Request | |
# id: cpr | |
# uses: peter-evans/create-pull-request@v4 | |
# with: | |
# token: ${{ secrets.GITHUB_TOKEN }} | |
# commit-message: "${{ needs.check-compose.outputs.rawhide_compose }} - ${{ steps.date.outputs.date }}" | |
# committer: cloudkitebot <[email protected]> | |
# author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> | |
# branch: cpr | |
# branch-suffix: random | |
# delete-branch: true | |
# title: "${{ needs.check-compose.outputs.rawhide_compose }} - ${{ steps.date.outputs.date }}" | |
# labels: auto-merge,fedora-rawhide | |
# body: | | |
# Fedora rawhide compose ${{ needs.check-compose.outputs.rawhide_compose }} | |
# - Date: ${{ steps.date.outputs.date }} | |
# - Compose URL: ${{ env.COMPOSE_URL_rawhide }} | |
# - Packages: | |
# - ${{ needs.check-compose.outputs.osbuild_version }} | |
# - ${{ needs.check-compose.outputs.osbuild_composer_version }} | |
# - ${{ needs.check-compose.outputs.composer_cli_version }} | |
# | |
# - name: Enable Pull Request Automerge | |
# if: steps.cpr.outputs.pull-request-operation == 'created' | |
# uses: peter-evans/enable-pull-request-automerge@v2 | |
# with: | |
# token: ${{ secrets.GITHUB_TOKEN }} | |
# pull-request-number: ${{ steps.cpr.outputs.pull-request-number }} | |
# merge-method: rebase | |
# | |
# - name: Add a comment to trigger test workflow | |
# uses: peter-evans/create-or-update-comment@v2 | |
# with: | |
# token: ${{ secrets.PAT }} | |
# issue-number: ${{ steps.cpr.outputs.pull-request-number }} | |
# body: /test-rawhide | |
# | |
# - name: Create a project card to track compose test result | |
# uses: peter-evans/create-or-update-project-card@v2 | |
# with: | |
# token: ${{ secrets.GITHUB_TOKEN }} | |
# project-name: Fedora Compose Test | |
# column-name: Fedora-rawhide | |
# issue-number: ${{ steps.cpr.outputs.pull-request-number }} | |
fedora-40: | |
# Do not need check-compose and make "workflow_dispatch" work for this job | |
if: github.repository == 'virt-s1/rhel-edge' && github.event.schedule != '0 4 * * *' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Get package version | |
id: package_version | |
run: | | |
curl -s "${COMPOSE_URL_F40}/COMPOSE_ID" --output COMPOSE_ID_F40 | |
COMPOSE_ID_F40=$(cat COMPOSE_ID_F40) | |
OSBUILD_VERSION_F40=$(curl -s "${UPDATES_URL_F40}/Everything/x86_64/os/Packages/o/" | grep -ioE ">osbuild-[0-9].*<" | tr -d "><") | |
OSBUILD_COMPOSER_VERSION_F40=$(curl -s "${UPDATES_URL_F40}/Everything/os/x86_64/Packages/o/" | grep -ioE ">osbuild-composer-[0-9].*<" | tr -d "><") | |
COMPOSER_CLI_VERSION_F40=$(curl -s "${COMPOSE_URL_F40}/Everything/x86_64/os/Packages/w/" | grep -ioE ">weldr-client-[0-9].*<" | tr -d "><") | |
echo "osbuild_version_f40=$OSBUILD_VERSION_F40" >> $GITHUB_OUTPUT | |
echo "osbuild_composer_version_f40=$OSBUILD_COMPOSER_VERSION_F40" >> $GITHUB_OUTPUT | |
echo "composer_cli_version_f40=$COMPOSER_CLI_VERSION_F40" >> $GITHUB_OUTPUT | |
echo "f40_compose=$COMPOSE_ID_F40" >> $GITHUB_OUTPUT | |
- name: Add new compose id in compose.f40 | |
run: | | |
compose_id="${{ steps.package_version.outputs.f40_compose }}" | |
echo $compose_id >> compose/compose.f40 | |
cat compose/compose.f40 | |
- name: Get current date | |
id: date | |
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT | |
- name: Create Pull Request | |
id: cpr | |
uses: peter-evans/create-pull-request@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
commit-message: "Fedora 40 Daily Compose Test - ${{ steps.date.outputs.date }}" | |
committer: cloudkitebot <[email protected]> | |
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> | |
branch: cpr | |
branch-suffix: random | |
delete-branch: true | |
title: " Fedora 40 Daily Compose Test- ${{ steps.date.outputs.date }}" | |
labels: DO_NOT_MERGE,fedora-40 | |
body: | | |
Fedora 40 compose ${{ steps.package_version.outputs.f40_compose }} | |
- Date: ${{ steps.date.outputs.date }} | |
- Compose URL: ${{ env.COMPOSE_URL_F40 }} | |
- Updates URL: ${{ env.UPDATES_URL_F40 }} | |
- Packages: | |
- ${{ steps.package_version.outputs.osbuild_version_f40 }} | |
- ${{ steps.package_version.outputs.osbuild_composer_version_f40 }} | |
- ${{ steps.package_version.outputs.composer_cli_version_f40 }} | |
- name: Add a comment to trigger test workflow | |
uses: peter-evans/create-or-update-comment@v2 | |
with: | |
token: ${{ secrets.PAT }} | |
issue-number: ${{ steps.cpr.outputs.pull-request-number }} | |
body: /test-f40 | |
- name: Create a project card to track compose test result | |
uses: peter-evans/create-or-update-project-card@v2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
project-name: Fedora Compose Test | |
column-name: Fedora-40 | |
issue-number: ${{ steps.cpr.outputs.pull-request-number }} | |
fedora-39: | |
# Do not need check-compose and make "workflow_dispatch" work for this job | |
if: github.repository == 'virt-s1/rhel-edge' && github.event.schedule != '0 16 * * *' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Get package version | |
id: package_version | |
run: | | |
curl -s "${COMPOSE_URL_F39}/COMPOSE_ID" --output COMPOSE_ID_F39 | |
COMPOSE_ID_F39=$(cat COMPOSE_ID_F39) | |
OSBUILD_VERSION_F39=$(curl -s "${UPDATES_URL_F39}/Everything/x86_64/Packages/o/" | grep -ioE ">osbuild-[0-9].*<" | tr -d "><") | |
OSBUILD_COMPOSER_VERSION_F39=$(curl -s "${UPDATES_URL_F39}/Everything/x86_64/Packages/o/" | grep -ioE ">osbuild-composer-[0-9].*<" | tr -d "><") | |
COMPOSER_CLI_VERSION_F39=$(curl -s "${COMPOSE_URL_F39}/Everything/x86_64/os/Packages/w/" | grep -ioE ">weldr-client-[0-9].*<" | tr -d "><") | |
echo "osbuild_version_f39=$OSBUILD_VERSION_F39" >> $GITHUB_OUTPUT | |
echo "osbuild_composer_version_f39=$OSBUILD_COMPOSER_VERSION_F39" >> $GITHUB_OUTPUT | |
echo "composer_cli_version_f39=$COMPOSER_CLI_VERSION_F39" >> $GITHUB_OUTPUT | |
echo "f39_compose=$COMPOSE_ID_F39" >> $GITHUB_OUTPUT | |
- name: Add new compose id in compose.f39 | |
run: | | |
compose_id="${{ steps.package_version.outputs.f39_compose }}" | |
echo $compose_id >> compose/compose.f39 | |
cat compose/compose.f39 | |
- name: Get current date | |
id: date | |
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT | |
- name: Create Pull Request | |
id: cpr | |
uses: peter-evans/create-pull-request@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
commit-message: "Fedora 39 Daily Compose Test - ${{ steps.date.outputs.date }}" | |
committer: cloudkitebot <[email protected]> | |
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> | |
branch: cpr | |
branch-suffix: random | |
delete-branch: true | |
title: " Fedora 39 Daily Compose Test- ${{ steps.date.outputs.date }}" | |
labels: DO_NOT_MERGE,fedora-39 | |
body: | | |
Fedora 39 compose ${{ steps.package_version.outputs.f39_compose }} | |
- Date: ${{ steps.date.outputs.date }} | |
- Compose URL: ${{ env.COMPOSE_URL_F39 }} | |
- Updates URL: ${{ env.UPDATES_URL_F39 }} | |
- Packages: | |
- ${{ steps.package_version.outputs.osbuild_version_f39 }} | |
- ${{ steps.package_version.outputs.osbuild_composer_version_f39 }} | |
- ${{ steps.package_version.outputs.composer_cli_version_f39 }} | |
- name: Add a comment to trigger test workflow | |
uses: peter-evans/create-or-update-comment@v2 | |
with: | |
token: ${{ secrets.PAT }} | |
issue-number: ${{ steps.cpr.outputs.pull-request-number }} | |
body: /test-f39 | |
- name: Create a project card to track compose test result | |
uses: peter-evans/create-or-update-project-card@v2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
project-name: Fedora Compose Test | |
column-name: Fedora-39 | |
issue-number: ${{ steps.cpr.outputs.pull-request-number }} |