Skip to content

Commit

Permalink
Repackage sdist
Browse files Browse the repository at this point in the history
  • Loading branch information
RazerM committed Aug 13, 2023
1 parent 9a179c2 commit 703b6c5
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions .github/workflows/wheel-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,29 @@ jobs:
- run: python -m venv .venv
- name: Install Python dependencies
run: .venv/bin/pip install -U pip build
- name: Make sdist
run: .venv/bin/python -m build --sdist
- name: Set SOURCE_DATE_EPOCH to last commit for reproducible build
run: |
echo "SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)"
echo "SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)" >> $GITHUB_ENV
- name: Make sdist
run: .venv/bin/python -m build --sdist
- name: Repackage using SOURCE_DATE_EPOCH
run: |
set -xe
cd dist
filename=$(find . -type f -name '*.tar.gz' -print0 | xargs -0 realpath)
mkdir scratch
tar xf "$filename" -C scratch
# cd into scratch so we can glob all files with `*`. Other approaches
# like `-C scratch .` adds a leading `./` to the archive names.
pushd scratch
export GZIP=--no-name
tar --sort=name --mtime="@$SOURCE_DATE_EPOCH" \
--owner=0 --group=0 --numeric-owner \
-czf "$filename" -- *
popd
rm -rf scratch
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: sdist
Expand Down

0 comments on commit 703b6c5

Please sign in to comment.