Skip to content

Commit

Permalink
ci: include submodules in source archive
Browse files Browse the repository at this point in the history
Fixes #1510.
  • Loading branch information
lidavidm committed Feb 2, 2024
1 parent 5e21134 commit 271698f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
submodules: recursive

# https://github.com/actions/checkout/issues/882
- name: Update tags
Expand Down Expand Up @@ -894,6 +896,7 @@ jobs:
with:
fetch-depth: 0
persist-credentials: true
submodules: recursive
- name: Get All Artifacts
uses: actions/download-artifact@v3
with:
Expand Down Expand Up @@ -937,6 +940,7 @@ jobs:
with:
fetch-depth: 0
persist-credentials: true
submodules: recursive
- name: Get All Artifacts
uses: actions/download-artifact@v3
with:
Expand Down
7 changes: 7 additions & 0 deletions ci/scripts/source_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ main() {
rm -rf "${base_name}/"
git archive "${revision}" --prefix "${base_name}/" | tar xf -

# Resolve all submodules
while read SUBMODULE; do
SUBMODULE_REV=$(echo "${SUBMODULE}" | awk '{print $1}')
SUBMODULE_PATH=$(echo "${SUBMODULE}" | awk '{print $2}')
git -C "${SUBMODULE_PATH}" archive --prefix="${base_name}/${SUBMODULE_PATH}/" "${SUBMODULE_REV}" | tar xf - -C "${source_top_dir}"
done < <(git submodule status)

# Resolve all hard and symbolic links
rm -rf "${base_name}.tmp/"
mv "${base_name}/" "${base_name}.tmp/"
Expand Down
1 change: 1 addition & 0 deletions dev/release/rat_exclude_files.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ r/*/NEWS.md
r/*/cran-comments.md
r/*/.Rbuildignore
r/*/tests/testthat/_snaps/*
testing/*

0 comments on commit 271698f

Please sign in to comment.