Skip to content

Commit

Permalink
CI,scripts: DRY around git submodules population
Browse files Browse the repository at this point in the history
  • Loading branch information
knocte committed Mar 9, 2024
1 parent d33fa0b commit 4488d66
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ jobs:
run: ./configure.sh --native-segwit
- name: Bump version to beta (because segwit)
run: |
git submodule foreach git fetch --all && git submodule sync --recursive && git submodule update --init --recursive
./scripts/populate_gitsubmodules.sh
dotnet fsi ./scripts/beta_bump.fsx
- name: pack&push
run: make push
Expand Down Expand Up @@ -585,7 +585,7 @@ jobs:

- name: Bump snap version
run: |
git submodule foreach git fetch --all && git submodule sync --recursive && git submodule update --init --recursive
./scripts/populate_gitsubmodules.sh
dotnet fsi ./scripts/beta_bump.fsx
- name: Generate snap package
Expand Down
11 changes: 1 addition & 10 deletions configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,7 @@ else

cp NuGet-legacy.config NuGet.config

if [ ! -f scripts/fsx/configure.sh ]; then
if ! which git >/dev/null 2>&1; then
echo "checking for git... not found" $'\n'

echo "$0" $'failed, please install "git" (to populate submodule) first'
exit 1
fi
echo "Populating sub-fsx module..."
git submodule sync --recursive && git submodule update --init --recursive
fi
./scripts/populate_gitsubmodules.sh

FSX_CHECK_MSG="checking for fsx..."
if ! which fsharpi >/dev/null 2>&1; then
Expand Down
2 changes: 1 addition & 1 deletion scripts/bump.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ let RunUpdateServers () =


if not replaceScript.Exists then
Console.Error.WriteLine "Script replace.fsx not found, 'fsx' submodule not populated? Please run `git submodule foreach git fetch --all && git submodule sync --recursive && git submodule update --init --recursive`"
Console.Error.WriteLine "Script replace.fsx not found, 'fsx' submodule not populated? Please run `populate_gitsubmodules.sh`"
Environment.Exit 1

GitDiff()
Expand Down
12 changes: 12 additions & 0 deletions scripts/populate_gitsubmodules.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -euo pipefail

if ! which git >/dev/null 2>&1; then
echo "checking for git... not found" $'\n'

echo "$0" $'failed, please install "git" (to populate submodules) first'
exit 1
fi
echo "Populating git submodules..."

git submodule foreach git fetch --all && git submodule sync --recursive && git submodule update --init --recursive

0 comments on commit 4488d66

Please sign in to comment.