Skip to content

Commit

Permalink
fix artifact_name, add package_version
Browse files Browse the repository at this point in the history
  • Loading branch information
nitzmahone committed Sep 6, 2024
1 parent ebc4163 commit 6537c59
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ env:
jobs:
python_sdist:
runs-on: ubuntu-22.04
outputs:
sdist_artifact_name: ${{ steps.build_sdist.outputs.sdist_artifact_name }}
package_version: ${{ steps.build_sdist.outputs.package_version }}
steps:
- name: clone repo
uses: actions/checkout@v4
Expand All @@ -45,14 +48,14 @@ jobs:
python -m pip install build
python -m build --sdist
echo "artifact_name=$(ls ./dist)" >> "$GITHUB_OUTPUT"
echo "package_version=$(ls ./dist | sed -En 's/cffi-(.+)\.tar\.gz/\1/p')" ?? "$GITHUB_OUTPUT"
echo "sdist_artifact_name=$(ls ./dist)" >> "$GITHUB_OUTPUT"
echo "package_version=$(ls ./dist | sed -En 's/cffi-(.+)\.tar\.gz/\1/p')" >> "$GITHUB_OUTPUT"
- name: upload sdist artifact
uses: actions/upload-artifact@v4
with:
name: ${{ steps.build_sdist.outputs.artifact_name }}
path: dist/${{ steps.build_sdist.outputs.artifact_name }}
name: ${{ steps.build_sdist.outputs.sdist_artifact_name }}
path: dist/${{ steps.build_sdist.outputs.sdist_artifact_name }}
if-no-files-found: error
# always upload the sdist artifact- all the wheel build jobs require it

Expand Down Expand Up @@ -262,7 +265,7 @@ jobs:
id: fetch_sdist
uses: actions/download-artifact@v4
with:
name: ${{ needs.build_sdist.outputs.artifact_name }}
name: ${{ needs.python_sdist.outputs.sdist_artifact_name }}

- name: configure docker foreign arch support
uses: docker/setup-qemu-action@v3
Expand Down Expand Up @@ -300,9 +303,11 @@ jobs:
run: |
set -eux
ls -lR ${{ steps.fetch_sdist.outputs.download-path }}
mkdir cffi
tar zxf ${{ steps.fetch_sdist.outputs.download-path }}/cffi*.tar.gz/cffi*.tar.gz --strip-components=1 -C cffi
tar zxf ${{ steps.fetch_sdist.outputs.download-path }}/cffi*.tar.gz --strip-components=1 -C cffi
python -m pip install --upgrade "${{ matrix.cibw_version || 'cibuildwheel' }}"
# actually build libffi + wheel (using env tweaks above)
Expand Down Expand Up @@ -395,7 +400,7 @@ jobs:
id: fetch_sdist
uses: actions/download-artifact@v4
with:
name: ${{ needs.build_sdist.outputs.artifact_name }}
name: ${{ needs.python_sdist.outputs.sdist_artifact_name }}

- name: install python
uses: actions/setup-python@v5
Expand Down Expand Up @@ -423,7 +428,7 @@ jobs:
mkdir cffi
tar zxf ${{ steps.fetch_sdist.outputs.download-path }}/cffi*.tar.gz/cffi*.tar.gz --strip-components=1 -C cffi
tar zxf ${{ steps.fetch_sdist.outputs.download-path }}/cffi*.tar.gz --strip-components=1 -C cffi
python3 -m cibuildwheel --output-dir dist cffi
Expand Down Expand Up @@ -498,7 +503,7 @@ jobs:
id: fetch_sdist
uses: actions/download-artifact@v4
with:
name: ${{ needs.build_sdist.outputs.artifact_name }}
name: ${{ needs.python_sdist.outputs.sdist_artifact_name }}

- name: build/test wheels
id: build
Expand All @@ -514,7 +519,7 @@ jobs:
mkdir cffi
tar zxf cffi*.tar.gz/cffi*.tar.gz --strip-components=1 -C cffi
tar zxf cffi*.tar.gz --strip-components=1 -C cffi
python -m pip install --upgrade pip
pip install "${{ matrix.cibw_version || 'cibuildwheel'}}"
Expand All @@ -539,7 +544,7 @@ jobs:
- name: merge all artifacts
uses: actions/upload-artifact/merge@v4
with:
name: dist-cffi-${{ needs.build_sdist.outputs.package_version }}
name: dist-cffi-${{ needs.python_sdist.outputs.package_version }}
delete-merged: true
if: ${{ env.skip_artifact_upload != 'true' }}

Expand Down

0 comments on commit 6537c59

Please sign in to comment.