Skip to content

Commit

Permalink
Merge pull request saltstack#63930 from s0undt3ch/hotfix/merge-forward
Browse files Browse the repository at this point in the history
Merge 3006.x into master
  • Loading branch information
garethgreenaway authored Mar 23, 2023
2 parents b6b6ccd + d86d733 commit 0b73c80
Show file tree
Hide file tree
Showing 106 changed files with 3,697 additions and 1,152 deletions.
28 changes: 1 addition & 27 deletions .github/actions/build-onedir-deps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,37 +43,11 @@ runs:
path: artifacts/${{ inputs.package-name }}
key: ${{ inputs.cache-prefix }}|${{ inputs.python-version }}|deps|${{ inputs.platform }}|${{ inputs.arch }}|${{ inputs.package-name }}|${{ hashFiles(format('{0}/.relenv/**/*.xz', github.workspace), 'requirements/static/pkg/*/*.txt', '.github/actions/build-onedir-deps/action.yml') }}

- name: Create Onedir Directory
shell: bash
if: steps.onedir-pkg-cache.outputs.cache-hit != 'true'
run: |
python3 -c "import os; os.makedirs('artifacts', exist_ok=True)"
python3 -m relenv create --arch=${{ inputs.arch }} --python=${{ inputs.python-version }} artifacts/${{ inputs.package-name }}
- name: Get Ondir Python Version
id: get-python-version
if: steps.onedir-pkg-cache.outputs.cache-hit != 'true'
uses: ./.github/actions/get-python-version
with:
python-binary: artifacts/${{ inputs.package-name }}/${{ inputs.platform == 'windows' && 'Scripts/python' || 'bin/python3' }}

- name: Install Wheel & Upgrade Setuptools & Pip
shell: bash
if: steps.onedir-pkg-cache.outputs.cache-hit != 'true'
run: |
${{ steps.get-python-version.outputs.binary }} -m pip install -U "wheel"
${{ steps.get-python-version.outputs.binary }} -m pip install -U "pip>=22.3.1,<23.0"
${{ steps.get-python-version.outputs.binary }} -m pip install -U "setuptools>=65.6.3,<66"
- name: Install Salt Onedir Package Dependencies
shell: bash
if: steps.onedir-pkg-cache.outputs.cache-hit != 'true'
run: |
if [ "${{ inputs.platform }}" != "windows" ]; then
${{ steps.get-python-version.outputs.binary }} -m pip install -r requirements/static/pkg/py${{ steps.get-python-version.outputs.version }}/${{ inputs.platform }}.txt --no-binary=':all:'
else
${{ steps.get-python-version.outputs.binary }} -m pip install -r requirements/static/pkg/py${{ steps.get-python-version.outputs.version }}/${{ inputs.platform }}.txt
fi
tools pkg build onedir-dependencies --arch ${{ inputs.arch }} --python-version ${{ inputs.python-version }} --package-name ${{ inputs.package-name }} --platform ${{ inputs.platform }}
- name: Cleanup Salt Onedir Directory
shell: bash
Expand Down
23 changes: 1 addition & 22 deletions .github/actions/build-onedir-salt/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,30 +53,9 @@ runs:
name: salt-${{ inputs.salt-version }}.tar.gz

- name: Install Salt Into Onedir
if: ${{ inputs.platform != 'windows' }}
env:
USE_STATIC_REQUIREMENTS: "1"
RELENV_PIP_DIR: "1"
shell: bash
run: |
artifacts/${{ inputs.package-name }}/bin/python3 -m pip install salt-${{ inputs.salt-version }}.tar.gz
if [ ${{ inputs.platform }} == "darwin" ]; then
pkg/macos/prep_salt.sh --build-dir ./artifacts/${{ inputs.package-name }}
rm -rf ./artifacts/${{ inputs.package-name }}/opt
rm -rf ./artifacts/${{ inputs.package-name }}/etc
rm -rf ./artifacts/${{ inputs.package-name }}/Library
fi
- name: Install Salt Into Onedir (Windows)
if: ${{ inputs.platform == 'windows' }}
env:
USE_STATIC_REQUIREMENTS: "1"
shell: powershell
run: |
# install salt
pkg\windows\install_salt.cmd -BuildDir ".\artifacts\${{ inputs.package-name }}" -CICD -SourceTarball salt-${{ inputs.salt-version }}.tar.gz
# prep salt
pkg\windows\prep_salt.cmd -BuildDir ".\artifacts\${{ inputs.package-name }}" -CICD
tools pkg build salt-onedir salt-${{ inputs.salt-version }}.tar.gz --platform ${{ inputs.platform }} --package-name ${{ inputs.package-name }}
- name: Cleanup Salt Onedir Directory
shell: bash
Expand Down
6 changes: 2 additions & 4 deletions .github/actions/build-source-tarball/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,12 @@ runs:
- name: Configure Git
shell: bash
run: |
git config --global user.name "Salt Project Packaging"
git config --global user.email [email protected]
tools pkg configure-git
- name: Apply Release Patch
shell: bash
run: |
git am --committer-date-is-author-date salt-${{ inputs.salt-version }}.patch
rm salt-${{ inputs.salt-version }}.patch
tools pkg apply-release-patch salt-${{ inputs.salt-version }}.patch --delete
- name: Create Source Tarball
shell: bash
Expand Down
8 changes: 8 additions & 0 deletions .github/actions/setup-python-tools-scripts/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
name: setup-python-tools-scripts
description: Setup 'python-tools-scripts'

inputs:
cwd:
type: string
description: The directory the salt checkout is located in
default: "."

outputs:
version:
value: ${{ steps.get-version.outputs.version }}
Expand All @@ -25,12 +31,14 @@ runs:

- name: Install 'python-tools-scripts'
shell: bash
working-directory: ${{ inputs.cwd }}
run: |
python3 -m pip install -r requirements/static/ci/py${{ steps.get-python-version.outputs.version }}/tools.txt
- name: Get 'python-tools-scripts' Version
id: get-version
shell: bash
working-directory: ${{ inputs.cwd }}
run: |
VERSION=$(tools --version)
echo "version=$VERSION" >> "${GITHUB_OUTPUT}"
2 changes: 1 addition & 1 deletion .github/actions/setup-relenv/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ inputs:
required: false
type: string
description: The version of relenv to use
default: 0.6.0
default: 0.9.0

outputs:
version:
Expand Down
43 changes: 24 additions & 19 deletions .github/workflows/build-deb-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ jobs:
image: ghcr.io/saltstack/salt-ci-containers/packaging:debian-11

steps:
# Checkout here so we can easily use custom actions
- uses: actions/checkout@v3

# Checkout here for the build process
- name: Checkout in build directory
uses: actions/checkout@v3
with:
path:
pkgs/checkout/
Expand All @@ -38,38 +43,38 @@ jobs:
name: salt-${{ inputs.salt-version }}-onedir-linux-${{ matrix.arch }}.tar.xz
path: pkgs/checkout/artifacts/

- name: Download System Dependencies
run: |
apt update
apt install -y python3 python3-venv python3-pip build-essential devscripts debhelper bash-completion git
- name: Download Release Patch
uses: actions/download-artifact@v3
with:
name: salt-${{ inputs.salt-version }}.patch
path: pkgs/checkout/

- name: Setup Python Tools Scripts
uses: ./.github/actions/setup-python-tools-scripts
with:
cwd: pkgs/checkout/

- name: Setup Salt Version
id: setup-salt-version
uses: ./.github/actions/setup-salt-version
with:
salt-version: "${{ inputs.salt-version }}"
cwd: pkgs/checkout/

- name: Configure Git
shell: bash
working-directory: pkgs/checkout/
run: |
git config --global user.name "Salt Project Packaging"
git config --global user.email [email protected]
tools pkg configure-git
- name: Apply Release Patch
shell: bash
- name: Apply release patch
working-directory: pkgs/checkout/
run: |
cd pkgs/checkout/
git am --committer-date-is-author-date salt-${{ inputs.salt-version }}.patch
rm salt-${{ inputs.salt-version }}.patch
tools pkg apply-release-patch salt-${{ inputs.salt-version }}.patch --delete
- name: Build Deb
env:
SALT_ONEDIR_ARCHIVE: "${{ github.workspace }}/pkgs/checkout/artifacts/salt-${{ inputs.salt-version }}-onedir-linux-${{ matrix.arch }}.tar.xz"
working-directory: pkgs/checkout/
run: |
cd pkgs/checkout/
echo "${{ inputs.salt-version }}" > salt/_version.txt
ln -sf pkg/debian/ .
debuild -e SALT_ONEDIR_ARCHIVE -uc -us
tools pkg build deb --onedir salt-${{ inputs.salt-version }}-onedir-linux-${{ matrix.arch }}.tar.xz
- name: Cleanup
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-deps-onedir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ on:
relenv-version:
required: false
type: string
default: 0.6.0
default: 0.9.0
description: The version of relenv to use
python-version-linux:
required: false
Expand Down
21 changes: 8 additions & 13 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,6 @@ jobs:
with:
name: salt-${{ inputs.salt-version }}.patch

- name: Configure Git
shell: bash
run: |
git config --global user.name "Salt Project Packaging"
git config --global user.email [email protected]
git config --global --add safe.directory "$(pwd)"
- name: Apply Release Patch
shell: bash
run: |
git am --committer-date-is-author-date salt-${{ inputs.salt-version }}.patch
rm salt-${{ inputs.salt-version }}.patch
- name: Get Python Version
id: get-python-version
uses: ./.github/actions/get-python-version
Expand All @@ -62,6 +49,14 @@ jobs:
id: python-tools-scripts
uses: ./.github/actions/setup-python-tools-scripts

- name: Configure Git
run: |
tools pkg configure-git
- name: Apply release patch
run: |
tools pkg apply-release-patch salt-${{ inputs.salt-version }}.patch --delete
- name: Cache Python Tools Docs Virtualenv
id: tools-venvs-dependencies-cache
uses: actions/cache@v3
Expand Down
16 changes: 3 additions & 13 deletions .github/workflows/build-macos-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,11 @@ jobs:
uses: actions/download-artifact@v3
with:
name: salt-${{ inputs.salt-version }}-onedir-darwin-${{ matrix.arch }}.tar.xz
path: artifacts/

- name: Decompress Onedir Tarball
- name: Build MacOS Package
run: |
mkdir -p artifacts
cd artifacts
tar xvf ${{ github.workspace }}/salt-${{ inputs.salt-version }}-onedir-darwin-${{ matrix.arch }}.tar.xz
cd ${{ github.workspace }}
mkdir -p pkg/macos/build/opt
cp -Rp artifacts/salt pkg/macos/build/opt/
- name: Build Package
run: |
cd pkg/macos
./prep_salt.sh
sudo ./package.sh -n ${{ inputs.salt-version }}
tools pkg build macos --onedir salt-${{ inputs.salt-version }}-onedir-darwin-${{ matrix.arch }}.tar.xz --salt-version ${{ inputs.salt-version }}
- name: Upload ${{ matrix.arch }} Package
uses: actions/upload-artifact@v3
Expand Down
30 changes: 13 additions & 17 deletions .github/workflows/build-rpm-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Download System Dependencies
run: |
yum -y update
yum -y install python3 python3-pip openssl git rpmdevtools rpmlint systemd-units libxcrypt-compat git
- name: Download Onedir Tarball as an Artifact
uses: actions/download-artifact@v3
with:
Expand All @@ -48,25 +43,26 @@ jobs:
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
shell: bash
run: |
git config --global user.name "Salt Project Packaging"
git config --global user.email [email protected]
git config --global --add safe.directory "$(pwd)"
tools pkg configure-git
- name: Apply Release Patch
shell: bash
- name: Apply release patch
run: |
git am --committer-date-is-author-date salt-${{ inputs.salt-version }}.patch
rm salt-${{ inputs.salt-version }}.patch
tools pkg apply-release-patch salt-${{ inputs.salt-version }}.patch --delete
- name: Build RPM
env:
SALT_ONEDIR_ARCHIVE: "${{ github.workspace }}/artifacts/salt-${{ inputs.salt-version }}-onedir-linux-${{ matrix.arch }}.tar.xz"
run: |
echo "${{ inputs.salt-version }}" > salt/_version.txt
rpmbuild -bb --define="_salt_src $(pwd)" "$(pwd)/pkg/rpm/salt.spec"
tools pkg build rpm --onedir salt-${{ inputs.salt-version }}-onedir-linux-${{ matrix.arch }}.tar.xz
- name: Upload RPMs
uses: actions/upload-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-salt-onedir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ on:
relenv-version:
required: false
type: string
default: 0.6.0
default: 0.9.0
description: The version of relenv to use
python-version-linux:
required: false
Expand Down
11 changes: 3 additions & 8 deletions .github/workflows/build-windows-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,11 @@ jobs:
uses: actions/download-artifact@v3
with:
name: salt-${{ inputs.salt-version }}-onedir-windows-${{ matrix.arch }}.zip
path: artifacts/

- name: Decompress Onedir Zipfile
- name: Build Windows Packages
run: |
py -3 -m zipfile -e salt-${{ inputs.salt-version }}-onedir-windows-${{ matrix.arch }}.zip pkg/windows/
mv pkg/windows/salt pkg/windows/buildenv
- name: Build Package
shell: powershell
run: |
& pkg/windows/build.cmd -Architecture ${{ matrix.arch }} -Version ${{ inputs.salt-version }} -CICD -SkipInstall
tools pkg build windows --onedir salt-${{ inputs.salt-version }}-onedir-windows-${{ matrix.arch }}.zip --salt-version ${{ inputs.salt-version }} --arch ${{ matrix.arch }}
- name: Upload ${{ matrix.arch }} Packages
uses: actions/upload-artifact@v3
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

env:
COLUMNS: 190
CACHE_SEED: SEED-3 # Bump the number to invalidate all caches
CACHE_SEED: SEED-5 # Bump the number to invalidate all caches
RELENV_DATA: "${{ github.workspace }}/.relenv"

permissions:
Expand Down Expand Up @@ -393,7 +393,7 @@ jobs:
salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}"
self-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }}
github-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['github-hosted'] }}
relenv-version: "0.7.0"
relenv-version: "0.9.0"
python-version-linux: "3.10.10"
python-version-macos: "3.10.10"
python-version-windows: "3.10.10"
Expand All @@ -411,7 +411,7 @@ jobs:
salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}"
self-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }}
github-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['github-hosted'] }}
relenv-version: "0.7.0"
relenv-version: "0.9.0"
python-version-linux: "3.10.10"
python-version-macos: "3.10.10"
python-version-windows: "3.10.10"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:

env:
COLUMNS: 190
CACHE_SEED: SEED-3 # Bump the number to invalidate all caches
CACHE_SEED: SEED-5 # Bump the number to invalidate all caches
RELENV_DATA: "${{ github.workspace }}/.relenv"

permissions:
Expand Down Expand Up @@ -437,7 +437,7 @@ jobs:
salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}"
self-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }}
github-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['github-hosted'] }}
relenv-version: "0.7.0"
relenv-version: "0.9.0"
python-version-linux: "3.10.10"
python-version-macos: "3.10.10"
python-version-windows: "3.10.10"
Expand All @@ -455,7 +455,7 @@ jobs:
salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}"
self-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }}
github-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['github-hosted'] }}
relenv-version: "0.7.0"
relenv-version: "0.9.0"
python-version-linux: "3.10.10"
python-version-macos: "3.10.10"
python-version-windows: "3.10.10"
Expand Down
Loading

0 comments on commit 0b73c80

Please sign in to comment.