Building the source tarball happens in a single job now

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
Pedro Algarvio 2023-01-18 18:44:07 +00:00 committed by Megan Wilhite
parent b2c4aa6cac
commit 3f7b5cc317
4 changed files with 77 additions and 55 deletions

View file

@ -28,10 +28,11 @@ runs:
path: artifacts/${{ inputs.package-name }}
key: ${{ env.CACHE_SEED }}|relenv|${{ env.RELENV_VERSION }}|deps|${{ inputs.platform }}|${{ inputs.arch }}|${{ inputs.package-name }}|${{ hashFiles(format('{0}/.relenv/**/*.xz', github.workspace), 'requirements/static/pkg/*/*.txt') }}
- name: Create Source Tarball
shell: bash
run: |
nox -e build
- name: Download Source Tarball
uses: actions/download-artifact@v3
with:
name: salt-${{ env.SALT_VERSION }}.tar.gz
path: dist/
- name: Install Salt Into Onedir
if: ${{ inputs.platform != 'windows' }}
@ -87,13 +88,6 @@ runs:
cd artifacts
Compress-Archive -LiteralPath "${{ inputs.package-name }}" -DestinationPath "${{ inputs.package-name }}-${{ inputs.arch }}-${{ inputs.platform }}.zip"
- name: Upload Source Tarball as an Artifact
uses: actions/upload-artifact@v3
with:
name: salt-${{ env.SALT_VERSION }}.tar.gz
path: dist/salt-*.tar.gz
retention-days: 7
- name: Upload Onedir Tarball as an Artifact
if: ${{ inputs.platform != 'windows' }}
uses: actions/upload-artifact@v3

View file

@ -0,0 +1,31 @@
---
name: build-source-tarball
description: Build Source Tarball
inputs:
nox-version:
required: false
type: string
description: The version of Nox to install
default: "2022.8.7"
runs:
using: composite
steps:
- name: Install Nox
shell: bash
run: |
nox --version || python3 -m pip install nox==${{ inputs.nox-version }}
- name: Create Source Tarball
shell: bash
run: |
nox -e build
- name: Upload Source Tarball as an Artifact
uses: actions/upload-artifact@v3
with:
name: salt-${{ env.SALT_VERSION }}.tar.gz
path: dist/salt-*.tar.gz
retention-days: 7

View file

@ -233,14 +233,45 @@ jobs:
with:
changed-files: ${{ needs.prepare-ci.outputs.changed-files }}
twine-check:
name: Twine Check
build-source-tarball:
name: Build Source Tarball
if: ${{ fromJSON(needs.prepare-ci.outputs.jobs)['github-hosted-runners'] }}
uses: ./.github/workflows/twine-check-action.yml
needs:
- prepare-ci
with:
changed-files: ${{ needs.prepare-ci.outputs.changed-files }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- 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: "${{ needs.prepare-ci.outputs.salt-version }}"
- name: Build Source Tarball
uses: ./.github/actions/build-source-tarball
- name: Set Exit Status
if: always()
run: |
python3 -c "import os; os.makedirs('exitstatus', exist_ok=True)"
echo "${{ job.status }}" > exitstatus/${{ github.job }}-source-tarball
- name: Upload Exit Status
if: always()
uses: actions/upload-artifact@v3
with:
name: exitstatus
path: exitstatus
if-no-files-found: error
build-deps-linux:
name: Build Onedir Salt Linux Dependencies
@ -294,6 +325,7 @@ jobs:
needs:
- prepare-ci
- build-deps-linux
- build-source-tarball
strategy:
fail-fast: false
matrix:
@ -395,6 +427,7 @@ jobs:
needs:
- prepare-ci
- build-deps-windows
- build-source-tarball
strategy:
fail-fast: false
matrix:
@ -497,6 +530,7 @@ jobs:
needs:
- prepare-ci
- build-deps-macos
- build-source-tarball
strategy:
fail-fast: false
matrix:
@ -570,6 +604,7 @@ jobs:
if: ${{ fromJSON(needs.prepare-ci.outputs.jobs)['self-hosted-runners'] }}
needs:
- prepare-ci
- build-salt-windows
uses: ./.github/workflows/build-windows-packages.yml
with:
salt-version: "${{ needs.prepare-ci.outputs.salt-version }}"
@ -579,6 +614,7 @@ jobs:
if: ${{ fromJSON(needs.prepare-ci.outputs.jobs)['self-hosted-runners'] }}
needs:
- prepare-ci
- build-salt-macos
uses: ./.github/workflows/build-macos-packages.yml
with:
salt-version: "${{ needs.prepare-ci.outputs.salt-version }}"

View file

@ -1,39 +0,0 @@
name: Twine Check
on:
workflow_call:
inputs:
changed-files:
required: true
type: string
description: JSON string containing information about changed files
jobs:
Twine-Check:
name: Run 'twine check' Against Salt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install dependencies
env:
PIP_EXTRA_INDEX_URL: https://pypi-proxy.saltstack.net/root/local/+simple/
run: |
pip install --upgrade pip setuptools wheel
pip install twine>=3.4.1
# pip install build # add build when implement pyproject.toml
- name: Create Source Tarball
run: |
python3 setup.py sdist
# TBD python3 -m build --sdist # replace with build when implement pyproject.toml
- name: Twine check
run: |
python3 -m twine check dist/*