Pass the salt version to use when building packages

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
Pedro Algarvio 2023-01-12 12:57:10 +00:00 committed by Megan Wilhite
parent 4e362e0b09
commit 76a1b2c3bc
7 changed files with 63 additions and 18 deletions

View file

@ -2,6 +2,9 @@
name: setup-salt-version
description: Setup Salt Version
inputs:
cwd:
type: string
default: ""
salt-version:
type: string
default: ""
@ -23,4 +26,7 @@ runs:
id: setup-salt-version
shell: bash
run: |
if [ "${{ inputs.cwd }}" != "" ]; then
cd "${{ inputs.cwd }}"
fi
tools pkg set-salt-version ${{ inputs.salt-version }}

View file

@ -1,10 +1,15 @@
name: Build Salt Packages
on:
- workflow_call
workflow_call:
inputs:
salt-version:
type: string
required: true
description: The Salt version to set prior to building packages.
jobs:
rpm:
build:
name: Build Deb
runs-on:
- self-hosted
@ -35,7 +40,9 @@ jobs:
USE_STATIC_REQUIREMENTS: "1"
run: |
cd build-deb-pkg
echo "${{ inputs.salt-version }}" > salt/_version.txt
ln -sf pkg/debian/ .
sed -i 's/SALT_RELEASE_VERSION/${{ inputs.salt-version }}/g' debian/changelog
debuild -uc -us
- name: Upload DEBs

View file

@ -2,7 +2,12 @@
name: Build MacOS Packages
on:
- workflow_call
workflow_call:
inputs:
salt-version:
type: string
required: true
description: The Salt version to set prior to building packages.
jobs:
@ -21,17 +26,21 @@ jobs:
with:
python-version: 3.9
- name: Get Salt Version
run: |
SALT_VERSION=$(python3 salt/version.py)
echo "SALT_VERSION=$SALT_VERSION" >> $GITHUB_ENV
- 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: Build Package
run: |
pkg/macos/build_python.sh
pkg/macos/install_salt.sh
pkg/macos/prep_salt.sh
pkg/macos/package.sh -n ${{ env.SALT_VERSION }}
pkg/macos/package.sh -n ${{ inputs.salt-version }}
- name: Upload ${{ matrix.arch }} Package
uses: actions/upload-artifact@v3

View file

@ -1,10 +1,15 @@
name: Build Salt Packages
on:
- workflow_call
workflow_call:
inputs:
salt-version:
type: string
required: true
description: The Salt version to set prior to building packages.
jobs:
rpm:
build:
name: Build RPM
runs-on:
- self-hosted
@ -32,6 +37,8 @@ jobs:
env:
USE_STATIC_REQUIREMENTS: "1"
run: |
echo "${{ inputs.salt-version }}" > salt/_version.txt
sed -i 's/^Version: \(.*\)$/Version: ${{ inputs.salt-version }}/g' pkg/rpm/salt.spec
rpmbuild -bb --define="_salt_src $(pwd)" $(pwd)/pkg/rpm/salt.spec
- name: Upload RPMs

View file

@ -2,7 +2,12 @@
name: Build Windows Packages
on:
- workflow_call
workflow_call:
inputs:
salt-version:
type: string
required: true
description: The Salt version to set prior to building packages.
jobs:
@ -22,16 +27,19 @@ jobs:
with:
python-version: 3.9
- name: Get Salt Version
shell: powershell
run: |
$env:SALT_VERSION=(py -3 salt/version.py)
Add-Content -Path $env:GITHUB_ENV -Value "SALT_VERSION=$env:SALT_VERSION"
- 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: Build Package
shell: powershell
run: |
& pkg/windows/build.cmd -Architecture ${{ matrix.arch }} -Version $env:SALT_VERSION -CICD
& pkg/windows/build.cmd -Architecture ${{ matrix.arch }} -Version ${{ inputs.salt-version }} -CICD
- name: Upload ${{ matrix.arch }} NSIS Package
uses: actions/upload-artifact@v3

View file

@ -551,6 +551,8 @@ jobs:
needs:
- prepare-ci
uses: ./.github/workflows/build-rpm-packages.yml
with:
salt-version: "${{ needs.prepare-ci.outputs.salt-version }}"
build-deb-pkgs:
name: Build DEB Packages
@ -558,6 +560,8 @@ jobs:
needs:
- prepare-ci
uses: ./.github/workflows/build-deb-packages.yml
with:
salt-version: "${{ needs.prepare-ci.outputs.salt-version }}"
build-windows-pkgs:
name: Build Windows Packages
@ -565,6 +569,8 @@ jobs:
needs:
- prepare-ci
uses: ./.github/workflows/build-windows-packages.yml
with:
salt-version: "${{ needs.prepare-ci.outputs.salt-version }}"
build-macos-pkgs:
name: Build macOS Packages
@ -572,6 +578,8 @@ jobs:
needs:
- prepare-ci
uses: ./.github/workflows/build-macos-packages.yml
with:
salt-version: "${{ needs.prepare-ci.outputs.salt-version }}"
windows-2016:

View file

@ -1,4 +1,4 @@
salt (3006.0) stable; urgency=medium
salt (SALT_RELEASE_VERSION) stable; urgency=medium
* Build of Salt with Relenv