Skip to content

Commit

Permalink
ci: distribution scaled down to pure source distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
giganano committed Oct 24, 2023
1 parent c2e1b0e commit 204153c
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 24 deletions.
60 changes: 37 additions & 23 deletions .github/workflows/sdist.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,59 @@
# This workflow creates a source distribution intended for uploading to PyPI
# and uploads it to GitHub actions as an artifact, where it then gets
# re-downloaded and combined with other wheels created by the wheels.yml
# workflow.
# This workflow creates a source distribution intended for uploading to PyPI,
# uploading the .tar.gz file to GitHub actions as an artifact. We upload the
# source distribution to PyPI manually. In previous versions of VICE, we
# pre-compiled the code and provided the binaries, but we have scaled this down
# for reasons described in the comments in the wheels.yml workflow file.
# Previously, the wheels.yml workflow would download this source distribution
# and combine it with the wheels created by bdist_linux.yml and bdist_macos.yml.

name: Source Distribution

# only when specifically requested
on:
workflow_call:
inputs:
os:
description: The OS to use for creating the source distribution
required: true
type: string
python-version:
description: The version of python for creating the source distribution
required: true
type: string
workflow_dispatch:
### previous inputs from wheels.yml, which would call this workflow ###
# workflow_call:
# inputs:
# os:
# description: The OS to use for creating the source distribution
# required: true
# type: string
# python-version:
# description: The version of python for creating the source distribution
# required: true
# type: string

jobs:
sdist:
name: Source Distribution
runs-on: ${{ inputs.os }}
env:
COMPILER: gcc
runs-on: ubuntu-latest
### previous inputs from wheels.yml, which would call this workflow ###
# runs-on: ${{ inputs.os }}
# env:
# COMPILER: gcc

steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Setup Python ${{ inputs.python-version }}
### previous inputs from wheels.yml, which would call this workflow ###
# - name: Setup Python ${{ inputs.python-version }}
# uses: actions/setup-python@v2
# with:
# python-version: ${{ inputs.python-version }}

- name: Setup Python 3.12
uses: actions/setup-python@v2
with:
python-version: ${{ inputs.python-version }}
python-version: "3.12"

- name: Install Dependencies
shell: bash
run: |
python -m pip install --upgrade pip
python -m pip install Cython>=0.29.21
python -m pip install build
python -m pip install setuptools>=18.0
python -m pip install Cython>=3.0
python -m pip install wheel>=0.33.0
- name: Display Environment Variables
Expand All @@ -54,9 +70,7 @@ jobs:
- name: Create Source Distribution
shell: bash
run: |
make
python setup.py sdist
make clean
python -m build --sdist
- name: Upload Source Distribution
uses: actions/upload-artifact@v2
Expand Down
19 changes: 18 additions & 1 deletion .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# This workflow is designed to pre-compile VICE for distribution across all
# versions of python supported by the code base. In the current version,
# however, we simply provide a source distribution will be compiled on each
# user's system. Previous versions had provided pre-compiled binaries, and the
# workflow code which produced those wheels is preserved here. The comments
# from the top of this workflow from this previous distribution strategy are
# copied below. As such, this workflow is generally not invoked; instead we
# dispatch the sdist.yml workflow to create the source distribution.
#
# We elect to provide only a source distribution because, with the limited
# architecture available through GitHub actions for Mac OS, it is likely that
# many end user's of VICE will have to compile in place anyway. This will only
# become more the case in the near future when users will compile it to enable
# multithreading, which will require an in-place compilation.
#
# Previous Notes on Distribution Strategy:
# ----------------------------------------
# This workflow pre-compiles VICE for distribution across all versions of
# python supported by the code base. Requiring a 64-bit system architecture,
# we pre-compile for x86_64 hardware on both Mac OS and Linux. As of yet,
Expand All @@ -9,7 +26,7 @@
#
# At present, GitHub actions does not support a build matrix for jobs that
# call a reusable workflow, so the Mac OS and manylinux jobs here implement
# the workaround from the following URL:
# the workaround from the following URL:
#
# https://github.community/t/reusable-workflow-with-strategy-matrix/205676/8

Expand Down

0 comments on commit 204153c

Please sign in to comment.