Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions data/project_types/simp_unknown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,6 @@ profile::github_actions::absent_action_files__rpms:
- tag_deploy_github-rpms-el7-el8.yml
- validate_tokens.yml

profile::github_actions::present_action_files__rpms_el7_el8:
- tag_deploy_github-rpms-el7-el8.yml
- release_rpms.yml
- validate_tokens_asset.yml
- add_new_issue_to_triage_project.yml

profile::github_actions::absent_action_files__rpms_el7_el8:
- pr_glci.yml # PR-triggered GLCI actions
- pr_glci_manual.yml # --> manual trigger for external contributors
- pr_glci_cleanup.yml # --> clean up old GLCI branches
- tag_deploy_github-only.yml
- tag_deploy_github-rpms.yml
- validate_tokens.yml

profile::github_actions::present_action_files__github_only:
- tag_deploy_github-only.yml # Release on tag
- validate_tokens_asset.yml
Expand Down
3 changes: 0 additions & 3 deletions data/repos/pkg-r10k.yaml

This file was deleted.

4 changes: 0 additions & 4 deletions data/repos/simp-adapter.yaml

This file was deleted.

73 changes: 73 additions & 0 deletions data/sync/configs/20260812-tag-deploy-rpm-matrix.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
# Roll out the reworked tag-and-release workflows (PR #44 + issue #84):
#
# - tag_deploy.yml: surface the Forge API response on failed publishes,
# preserve the built module archive (workflow artifact + release
# asset), and dispatch release_rpms.yml ONCE with no build-OS
# override (the hardcoded centos7/centos8 matrix was overriding
# #80's el8 default and failing every tag-triggered RPM build)
# - release_rpms.yml: the build-OS matrix now lives here
# (build_container_oses, default el8/el9/el10), with per-release
# work split into a resolve-release job so parallel per-OS legs
# can't race on release creation or asset wipes
#
# Scoped to those two files; both are fleet-uniform, so no
# preserve_blocks are needed (Renovate-managed scalars are preserved as
# always).
#
# Dynamic-inventory session: run with `repolist=github-org` (or point
# the repolists latest.yaml there). NOTE: the simp-* asset repos
# (simp-doc, simp-utils, ...) also carry affected tag_deploy variants
# but are not in the dynamic inventory or permitted types -- they need
# a separate follow-up pass.
puppetsync::plan_config:
puppetsync:
permitted_project_types:
- pupmod
- pupmod_skeleton
plans:
sync:
github_api_delay_seconds: 1
merge_github_workflows:
files:
- tag_deploy.yml
- release_rpms.yml
stages:
- install_gems
- checkout_git_feature_branch_in_each_repo
- merge_github_workflows
- git_commit_changes
- ensure_github_fork
- ensure_git_remote
- git_push_to_remote
- ensure_github_pr

approve_github_prs:
stages:
- approve_github_pr_for_each_repo

merge_github_prs:
stages:
- merge_github_pr_for_each_repo

git:
feature_branch: puppetsync/20260812-tag-deploy-rpm-matrix
commit_message: |
[puppetsync] Fix tag-triggered RPM builds and harden tag_deploy

Every tag push has been dispatching two release_rpms.yml runs
hardcoded to the retired centos7/centos8 build containers, so all
tag-triggered RPM builds fail. tag_deploy.yml now dispatches once
with no OS override, and release_rpms.yml builds el8/el9/el10 from
a single build_container_oses input (narrowable on manual runs),
with release resolution split into its own job so the parallel
per-OS legs cannot race on release creation or asset wipes.

tag_deploy.yml also now surfaces the Puppet Forge API response when
a publish fails (instead of curl --fail discarding it) and keeps
the built module archive as a workflow artifact and release asset.

github:
pr_user: silug # This should be the account that *submitted* the PRs
# (Used by idempotency checks when approving/merging PRs)
approval_message: ':+1: :ghost:'
2 changes: 1 addition & 1 deletion data/sync/configs/latest.yaml
104 changes: 61 additions & 43 deletions modules/profile/files/_github/workflows/release_rpms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ on:
description: "Create release if missing? (tag must exist)"
required: false
default: 'yes'
build_container_os:
description: "Build container OS"
required: true
default: 'el8'
build_container_oses:
description: "Build container OSes (JSON list)"
required: false
default: '["el8","el9","el10"]'
build_container_tag:
description: "Build container tag"
required: true
required: false
default: 'latest'
target_repo:
description: "Target repo (instead of this one)"
Expand Down Expand Up @@ -90,13 +90,20 @@ env:
RELEASE_TAG: ${{ github.event.inputs.release_tag }}

jobs:
create-and-attach-rpms-to-github-release:
# Per-release work (resolve or create the release, optionally wipe its
# assets) runs ONCE; the per-OS builds fan out from it below.
# See simp/puppetsync#84
resolve-release:
name: >
Build and attach RPMs to Release:
Resolve GitHub Release:
${{ (github.event.inputs.target_repo != null && format('{0}/{1}', github.repository_owner, github.event.inputs.target_repo)) || github.repository }}
${{ github.event.inputs.release_tag }}
(build os: ${{ github.event.inputs.build_container_os }})
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
outputs:
release_id: ${{ steps.release-api.outputs.id }}
build_semver: ${{ steps.validate-inputs.outputs.build_semver }}
prebuild_suffix: ${{ steps.validate-inputs.outputs.prebuild_suffix }}
prebuild_number: ${{ steps.validate-inputs.outputs.prebuild_number }}
steps:
- name: "Validate inputs"
id: validate-inputs
Expand All @@ -108,13 +115,13 @@ jobs:

if [[ "$RELEASE_TAG" =~ ^(simp-|v)?([0-9]+\.[0-9]+\.[0-9]+)(-(rc|RC|[Aa]lpha|[Bb]eta|pre|post)?([0-9]+)?)?$ ]]; then
if [ -n "${BASH_REMATCH[5]}" ]; then
echo "{prebuild_number}={${BASH_REMATCH[5]#-}}" >> $GITHUB_OUTPUT
echo "prebuild_number=${BASH_REMATCH[5]#-}" >> $GITHUB_OUTPUT
fi
if [ -n "${BASH_REMATCH[3]}" ]; then
echo "{prebuild_suffix}={${BASH_REMATCH[3]#-}}" >> $GITHUB_OUTPUT
echo "prebuild_suffix=${BASH_REMATCH[3]#-}" >> $GITHUB_OUTPUT
fi
if [ -n "${BASH_REMATCH[2]}" ]; then
echo "{build_semver}={${BASH_REMATCH[2]}}" >> $GITHUB_OUTPUT
echo "build_semver=${BASH_REMATCH[2]}" >> $GITHUB_OUTPUT
fi
else
printf '::error ::Release Tag format is not SemVer, X.Y.Z-R, X.Y.Z-<prerelease>: "%s"\n' "$RELEASE_TAG"
Expand All @@ -124,13 +131,12 @@ jobs:
- name: >
Query info for ${{ env.TARGET_REPO }}
release ${{ github.event.inputs.release_tag }} ${{ steps.validate-inputs.outputs.prebuild_suffix }}
build os ${{ github.event.inputs.build_container_os }}
(autocreate_release = '${{ github.event.inputs.autocreate_release }}')
id: release-api
env:
AUTOCREATE_RELEASE: ${{ github.event.inputs.autocreate_release }}
PREBUILD_TAG: ${{ steps.validate-inputs.outputs.prebuild_suffix }}
uses: actions/github-script@v6
uses: actions/github-script@v9
with:
github-token: ${{ github.event.inputs.target_repo_token || secrets.GITHUB_TOKEN }}
script: |
Expand Down Expand Up @@ -197,20 +203,51 @@ jobs:
err => { throw err }
)

- name: "Wipe all previous assets from GitHub Release (when clean == 'yes')"
if: ${{ github.event.inputs.clean == 'yes' && github.event.inputs.dry_run != 'yes' }}
uses: actions/github-script@v9
env:
release_id: ${{ steps.release-api.outputs.id }}
with:
github-token: ${{ github.event.inputs.target_repo_token || secrets.GITHUB_TOKEN }}
script: |
const release_id = process.env.release_id
const [owner, repo] = process.env.TARGET_REPO.split('/')
const existingAssets = await github.rest.repos.listReleaseAssets({ owner, repo, release_id })

console.log( ` !! !! Wiping ALL uploaded assets for ${owner}/${repo} release (id: ${release_id})`)
existingAssets.data.forEach(async function(asset){
asset_id = asset.id
console.log( ` !! !! !! Wiping existing asset for ${asset.name} (id: ${asset_id})`)
await github.rest.repos.deleteReleaseAsset({ owner, repo, asset_id })
})

create-and-attach-rpms-to-github-release:
name: >
Build and attach RPMs to Release:
${{ (github.event.inputs.target_repo != null && format('{0}/{1}', github.repository_owner, github.event.inputs.target_repo)) || github.repository }}
${{ github.event.inputs.release_tag }}
(build os: ${{ matrix.os }})
needs: [ resolve-release ]
runs-on: ubuntu-24.04
strategy:
matrix:
os: ${{ fromJSON(github.event.inputs.build_container_oses) }}
steps:
- name: Checkout code
uses: actions/checkout@v5
uses: actions/checkout@v7
with:
repository: ${{ env.TARGET_REPO }}
ref: ${{ env.RELEASE_TAG }}
clean: true
fetch-depth: 0

- name: 'Customize RPM Release tag via build/rpm_metadata/release (pre-release only)'
if: steps.validate-inputs.outputs.prebuild_suffix
if: needs.resolve-release.outputs.prebuild_suffix
env:
BUILD_SEMVER: ${{ steps.validate-inputs.outputs.build_semver }}
PREBUILD_TAG: ${{ steps.validate-inputs.outputs.prebuild_suffix }}
PREBUILD_NUMBER: ${{ steps.validate-inputs.outputs.prebuild_number }}
BUILD_SEMVER: ${{ needs.resolve-release.outputs.build_semver }}
PREBUILD_TAG: ${{ needs.resolve-release.outputs.prebuild_suffix }}
PREBUILD_NUMBER: ${{ needs.resolve-release.outputs.prebuild_number }}
# Note: To accomodate the capabilities of EL7's version of RPM, the
# release number is formatted according to the Fedora Packaging
# Guidelines' "Traditional versioning" conventions:
Expand All @@ -233,7 +270,7 @@ jobs:
- name: 'Customize RPM Release tag via build/rpm_metadata/release (RPM rebuild)'
if: ${{ github.event.inputs.rebuild_number != '' }}
env:
BUILD_SEMVER: ${{ steps.validate-inputs.outputs.build_semver }}
BUILD_SEMVER: ${{ needs.resolve-release.outputs.build_semver }}
REBUILD_NUMBER: ${{ github.event.inputs.rebuild_number }}
run: |
mkdir -p build/rpm_metadata
Expand All @@ -249,44 +286,25 @@ jobs:
- name: >
Build & Sign RPMs for
${{ github.event.inputs.release_tag }}
Release (${{ github.event.inputs.build_container_os }})
Release (${{ matrix.os }})
uses: simp/github-action-build-and-sign-pkg-single-rpm@v2
id: build-and-sign-rpm
with:
gpg_signing_key: ${{ secrets.SIMP_DEV_GPG_SIGNING_KEY }}
gpg_signing_key_id: ${{ secrets.SIMP_DEV_GPG_SIGNING_KEY_ID }}
gpg_signing_key_passphrase: ${{ secrets.SIMP_DEV_GPG_SIGNING_KEY_PASSPHRASE }}
simp_core_ref_for_building_rpms: ${{ secrets.SIMP_CORE_REF_FOR_BUILDING_RPMS }}
simp_builder_docker_image: 'ghcr.io/simp/simp-${{ github.event.inputs.build_container_os }}-build:${{ github.event.inputs.build_container_tag }}'
simp_builder_docker_image: 'ghcr.io/simp/simp-${{ matrix.os }}-build:${{ github.event.inputs.build_container_tag }}'
path_to_build: "${{ (github.event.inputs.path_to_build != null && format('{0}/{1}', github.workspace, github.event.inputs.path_to_build)) || github.workspace }}"
verbose: 'no' #${{ github.event.inputs.verbose }}

- name: "Wipe all previous assets from GitHub Release (when clean == 'yes')"
if: ${{ github.event.inputs.clean == 'yes' && github.event.inputs.dry_run != 'yes' }}
uses: actions/github-script@v6
env:
release_id: ${{ steps.release-api.outputs.id }}
with:
github-token: ${{ github.event.inputs.target_repo_token || secrets.GITHUB_TOKEN }}
script: |
const release_id = process.env.release_id
const [owner, repo] = process.env.TARGET_REPO.split('/')
const existingAssets = await github.rest.repos.listReleaseAssets({ owner, repo, release_id })

console.log( ` !! !! Wiping ALL uploaded assets for ${owner}/${repo} release (id: ${release_id})`)
existingAssets.data.forEach(async function(asset){
asset_id = asset.id
console.log( ` !! !! !! Wiping existing asset for ${asset.name} (id: ${asset_id})`)
await github.rest.repos.deleteReleaseAsset({ owner, repo, asset_id })
})

- name: "Upload RPM file(s) to GitHub Release (dry_run != 'yes')"
if: ${{ github.event.inputs.dry_run != 'yes' }}
uses: actions/github-script@v6
uses: actions/github-script@v9
env:
rpm_file_paths: ${{ steps.build-and-sign-rpm.outputs.rpm_file_paths }}
rpm_gpg_file: ${{ steps.build-and-sign-rpm.outputs.rpm_gpg_file }}
release_id: ${{ steps.release-api.outputs.id }}
release_id: ${{ needs.resolve-release.outputs.release_id }}
clobber: ${{ github.event.inputs.clobber }}
clean: ${{ github.event.inputs.clean }}
dry_run: ${{ github.event.inputs.dry_run }}
Expand Down
Loading