Start building onedir packages

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
Pedro Algarvio 2023-01-17 04:50:55 +00:00 committed by Pedro Algarvio
parent e26706011f
commit 64afd87958
3 changed files with 163 additions and 0 deletions

View file

@ -0,0 +1,36 @@
---
name: build-onedir-bare
description: Build Bare Onedir Package
inputs:
platform:
required: true
type: string
description: The platform to build
arch:
required: true
type: string
description: The platform arch to build
package-name:
required: false
type: string
description: The onedir package name to create
default: salt
runs:
using: composite
steps:
- name: Cache Bare Onedir Package Directory
id: onedir-pkg-cache
uses: actions/cache@v3
with:
path: artifacts/${{ inputs.package-name }}
key: relenv|${{ env.RELENV_VERSION }}|bare|${{ inputs.platform }}|${{ inputs.arch }}|${{ inputs.package-name }}|${{ hashFiles('.relenv/**/*.xz') }}
- 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 }} artifacts/${{ inputs.package-name }}

124
.github/workflows/build-salt-action.yml vendored Normal file
View file

@ -0,0 +1,124 @@
---
name: Build Salt Onedir
on:
- workflow_call
jobs:
linux:
name: Linux
strategy:
fail-fast: false
matrix:
arch:
- x86_64
- aarch64
runs-on:
- self-hosted
- linux
- ${{ matrix.arch }}
steps:
- uses: actions/checkout@v3
- name: Setup Relenv
uses: ./.github/actions/setup-relenv
with:
platform: linux
arch: ${{ matrix.arch }}
- name: Install Salt into Relenv Onedir
uses: ./.github/actions/build-onedir-pkg
with:
platform: linux
arch: ${{ matrix.arch }}
- name: Set Exit Status
if: always()
run: |
python3 -c "import os; os.makedirs('exitstatus', exist_ok=True)"
echo "${{ job.status }}" > exitstatus/${{ github.job }}-linux-${{ matrix.arch }}
- name: Upload Exit Status
if: always()
uses: actions/upload-artifact@v3
with:
name: exitstatus
path: exitstatus
if-no-files-found: error
windows:
name: Windows
strategy:
fail-fast: false
matrix:
arch:
- amd64
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Setup Relenv
uses: ./.github/actions/setup-relenv
with:
platform: windows
arch: ${{ matrix.arch }}
- name: Install Salt into Relenv Onedir
uses: ./.github/actions/build-onedir-pkg
with:
platform: windows
arch: ${{ matrix.arch }}
- name: Set Exit Status
if: always()
run: |
python3 -c "import os; os.makedirs('exitstatus', exist_ok=True)"
echo "${{ job.status }}" > exitstatus/${{ github.job }}-windows-${{ matrix.arch }}
- name: Upload Exit Status
if: always()
uses: actions/upload-artifact@v3
with:
name: exitstatus
path: exitstatus
if-no-files-found: error
macos:
name: macOS
strategy:
fail-fast: false
matrix:
arch:
- x86_64
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Setup Relenv
uses: ./.github/actions/setup-relenv
with:
platform: darwin
arch: ${{ matrix.arch }}
- name: Install Salt into Relenv Onedir
uses: ./.github/actions/build-onedir-pkg
with:
platform: darwin
arch: ${{ matrix.arch }}
- name: Set Exit Status
if: always()
run: |
python3 -c "import os; os.makedirs('exitstatus', exist_ok=True)"
echo "${{ job.status }}" > exitstatus/${{ github.job }}-macos-${{ matrix.arch }}
- name: Upload Exit Status
if: always()
uses: actions/upload-artifact@v3
with:
name: exitstatus
path: exitstatus
if-no-files-found: error

View file

@ -329,6 +329,9 @@ def _install_requirements(
if not _upgrade_pip_setuptools_and_wheel(session, onedir=onedir):
return False
if onedir and not IS_WINDOWS and not IS_DARWIN and not IS_FREEBSD:
session_run_always(session, "python3", "-m", "relenv", "toolchain", "fetch")
# Install requirements
requirements_file = _get_pip_requirements_file(
session, transport, requirements_type=requirements_type