mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
93 lines
2.6 KiB
YAML
93 lines
2.6 KiB
YAML
---
|
|
name: Build RPM Packages
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
salt-version:
|
|
type: string
|
|
required: true
|
|
description: The Salt version to set prior to building packages.
|
|
|
|
env:
|
|
COLUMNS: 190
|
|
|
|
jobs:
|
|
build:
|
|
name: RPM
|
|
runs-on:
|
|
- self-hosted
|
|
- linux
|
|
- ${{ matrix.arch }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
arch:
|
|
- x86_64
|
|
- aarch64
|
|
source:
|
|
- onedir
|
|
- src
|
|
|
|
container:
|
|
image: ghcr.io/saltstack/salt-ci-containers/packaging:centosstream-9
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Download Onedir Tarball as an Artifact
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: salt-${{ inputs.salt-version }}-onedir-linux-${{ matrix.arch }}.tar.xz
|
|
path: artifacts/
|
|
|
|
- name: Download Release Patch
|
|
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: salt-${{ inputs.salt-version }}.patch
|
|
|
|
- name: Setup Python Tools Scripts
|
|
uses: ./.github/actions/setup-python-tools-scripts
|
|
|
|
- name: Setup Salt Version
|
|
id: setup-salt-version
|
|
uses: ./.github/actions/setup-salt-version
|
|
with:
|
|
salt-version: "${{ inputs.salt-version }}"
|
|
|
|
- name: Configure Git
|
|
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
|
|
run: |
|
|
tools pkg configure-git
|
|
|
|
- name: Apply release patch
|
|
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
|
|
run: |
|
|
tools pkg apply-release-patch salt-${{ inputs.salt-version }}.patch --delete
|
|
|
|
- name: Build RPM
|
|
run: |
|
|
tools pkg build rpm ${{
|
|
matrix.source == 'onedir' &&
|
|
format('--onedir=salt-{0}-onedir-linux-{1}.tar.xz', inputs.salt-version, matrix.arch)
|
|
||
|
|
format('--arch={0}', matrix.arch)
|
|
}}
|
|
|
|
- name: Set Artifact Name
|
|
id: set-artifact-name
|
|
run: |
|
|
if [ "${{ matrix.source }}" != "src" ]; then
|
|
echo "artifact-name=salt-${{ inputs.salt-version }}-${{ matrix.arch }}-rpm" >> "$GITHUB_OUTPUT"
|
|
else
|
|
echo "artifact-name=salt-${{ inputs.salt-version }}-${{ matrix.arch }}-rpm-from-src" >> "$GITHUB_OUTPUT"
|
|
fi
|
|
|
|
- name: Upload RPMs
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: ${{ steps.set-artifact-name.outputs.artifact-name }}
|
|
path: ~/rpmbuild/RPMS/${{ matrix.arch }}/*.rpm
|
|
retention-days: 7
|
|
if-no-files-found: error
|