Skip to content
Merged
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
84 changes: 11 additions & 73 deletions .github/workflows/promote.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
required: true
type: string
branch:
description: 'Branch to promote to (defaults to main)'
description: 'Branch to promote to'
required: false
default: 'main'
type: choice
Expand All @@ -24,75 +24,13 @@ permissions: {}

jobs:
promote:
runs-on: ubuntu-26.04
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ inputs.branch }}
token: ${{ secrets.OPENVOXBOT_COMMIT_AND_PRS }}
fetch-depth: 0 # required for vanagon below to determine the openvox version

- name: Setup git and SSH signing
id: git_identity
uses: OpenVoxProject/shared-actions/.github/actions/setup-git-ssh-signing@main
with:
ssh_private_key: ${{ secrets.OPENVOXBOT_SSH_PRIVATE_KEY }}

- name: Validate component exists
run: |
component="${{ inputs.component }}"
if [[ ! -f "packaging/configs/components/${component}.json" ]]; then
echo "::error::Could not find packaging/configs/components/${component}.json"
exit 1
fi

- name: Generate component JSON
id: generate
run: |
component="${{ inputs.component }}"
ref="${{ inputs.ref }}"

if [[ "${component}" =~ ^(puppet-runtime|openssl-fips)$ ]]; then
# Munge the ref: replace - with .
munged="${ref//-/.}"
json="{\"location\":\"https://s3.osuosl.org/openvox-artifacts/${component}/${ref}/\",\"version\":\"${munged}\"}"
else
json="{\"url\":\"https://github.com/openvoxproject/${component}.git\",\"ref\":\"${ref}\"}"
fi

echo "json=${json}" >> "$GITHUB_OUTPUT"
echo "Generated JSON: ${json}"

- name: Write component JSON
run: |
component="${{ inputs.component }}"
echo '${{ steps.generate.outputs.json }}' > "packaging/configs/components/${component}.json"
echo "Wrote packaging/configs/components/${component}.json:"
cat "packaging/configs/components/${component}.json"
- name: Install Ruby
uses: ruby/setup-ruby@de492cf36cbab201753d720ce4f4e336cd688c94 # v1.336.0
with:
ruby-version: ruby
bundler-cache: true
# downloads all required components and fails if one isn't available
# basically ensures our inputs.ref doesn't contain typos
- name: Validate Vanagon render
working-directory: packaging/
run: bundle exec vanagon render openvox-agent el-10-x86_64

- name: Create Pull Request
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
with:
commit-message: "Promote ${{ inputs.component }} ${{ inputs.ref }} into ${{ inputs.branch }}"
branch: "promote/${{ inputs.branch }}/${{ inputs.component }}/${{ inputs.ref }}"
delete-branch: true
title: "Promote ${{ inputs.component }} ${{ inputs.ref }} into ${{ inputs.branch }}"
token: ${{ secrets.OPENVOXBOT_COMMIT_AND_PRS }}
assignees: '${{ github.triggering_actor }}'
author: '${{ steps.git_identity.outputs.git_author_name }} <${{ steps.git_identity.outputs.git_author_email }}>'
committer: '${{ steps.git_identity.outputs.git_committer_name }} <${{ steps.git_identity.outputs.git_committer_email }}>'
signoff: true
base: ${{ inputs.branch }}
body: |
Automated promotion of ${{ inputs.component }} to ref ${{ inputs.ref }} in ${{ inputs.branch }}.
uses: OpenVoxProject/shared-actions/.github/workflows/promote.yml@main
with:
component: ${{ inputs.component }}
ref: ${{ inputs.ref }}
branch: ${{ inputs.branch }}
validate_command: bundle exec vanagon render openvox-agent el-10-x86_64
validate_working_directory: packaging/
secrets:
github_pat: ${{ secrets.OPENVOXBOT_COMMIT_AND_PRS }}
ssh_private_key: ${{ secrets.OPENVOXBOT_SSH_PRIVATE_KEY }}
Loading