Skip to content

Commit

Permalink
find-container-digest: fix invoking from other repos
Browse files Browse the repository at this point in the history
If we export-ignore the action, it can't be used from other repos.
Continue export-ignoring other children of .github, to keep raw exports
(e.g. GitHub source Zips) relatively clean, and then remove the action
from postprocess-sdist.py.

Fixes: c8c9c06 ("Generate sdist archive with `meson dist`")
Signed-off-by: Benjamin Gilbert <[email protected]>
  • Loading branch information
bgilbert committed Dec 7, 2023
1 parent 16ceb66 commit 4b5306c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
*.sh eol=lf

# Don't include Git/GitHub metadata and development tool configs in
# sdist tarballs
# sdist tarballs.
# Don't ignore the find-container-digest composite action; remove it from
# postprocess-sdist.py. This is necessary so other repos can use the action.
.gitattributes export-ignore
.gitignore export-ignore
/.github export-ignore
/.github/ISSUE_TEMPLATE export-ignore
/.github/workflows export-ignore
/.pre-commit-config.yaml export-ignore
/pyproject.toml export-ignore
4 changes: 4 additions & 0 deletions artifacts/postprocess-sdist.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import os
from pathlib import Path
import shutil
import sys

# handle our own PYTHONPATH prepending, since meson can't set environment
Expand All @@ -47,6 +48,9 @@ class Args(TypedArgs):
os.environ['MESONINTROSPECT'] = args.introspect
dest = Path(os.environ['MESON_DIST_ROOT'])

# remove those parts of .github not ignored from .gitattributes
shutil.rmtree(dest / '.github')

# pin openslide-bin version suffix
version: str = meson_introspect('projectinfo')['version']
try:
Expand Down

0 comments on commit 4b5306c

Please sign in to comment.