Skip to content

Commit 819c923

Browse files
committed
Modified build.sh to be compatible with reusable github action.
1 parent dba6624 commit 819c923

File tree

1 file changed

+3
-38
lines changed

1 file changed

+3
-38
lines changed

build.sh

+3-38
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,17 @@
1-
#!/bin/bash
1+
PROJECT="$(echo "$1" | rev | cut -d/ -f1 | rev)"
22

3-
set -e
3+
cd contrib-api-doc
44

5-
# TODO - remove
6-
PROJECT=tools.deps.alpha
7-
8-
# Create or refresh repo
9-
if [[ ! -d repo ]]; then
10-
echo "Creating new repo area"
11-
git clone "[email protected]:clojure/$PROJECT.git" repo
12-
else
13-
echo "Refreshing repo area"
14-
(cd repo && git fetch && git reset --hard)
15-
fi
165
version="$(cd repo && mvn -q -N org.codehaus.mojo:exec-maven-plugin:1.3.1:exec -Dexec.executable='echo' -Dexec.args='${project.version}' | tail -1)"
176
echo "version=$version"
187

19-
# Create or clean output directory
20-
if [[ ! -d repo-docs ]]; then
21-
echo "Creating new gh-pages area"
22-
git clone "[email protected]:clojure/$PROJECT.git" repo-docs
23-
(cd repo-docs && git checkout gh-pages)
24-
else
25-
echo "Refreshing gh-pages area"
26-
(cd repo-docs && git fetch && git reset --hard)
27-
fi
28-
rm -rf repo-docs/*
29-
30-
# Copy stable site files
318
echo "Copying static site files"
329
cp -R site/* repo-docs
3310

34-
# Run autodoc-collect
3511
echo "Analyzing $PROJECT"
3612
rm -f analysis.edn
3713
echo "(def PROJECT \"$PROJECT\") (def VERSION \"$version\")" > proj.clj
38-
cat proj.clj collect.clj | clojure -Sforce -J-Dclojure.spec.skip-macros=true -M:collect -
14+
cat proj.clj collect.clj | clojure -Sforce -J-Dclojure.spec.skip-macros=true -Sdeps "{:deps {org.clojure/${PROJECT} {:mvn/version \"RELEASE\"}}}" -M:collect -
3915

40-
# Run autodoc
4116
echo "Building $PROJECT"
4217
cat proj.clj build.clj | clojure -M:build -
43-
44-
# Commit
45-
if [[ ! -z "$COMMIT" ]]; then
46-
echo "Committing updated gh-pages branch"
47-
cd repo-docs
48-
git add -u -v
49-
git commit -m "Autodoc commit"
50-
git config --global push.default simple
51-
git push
52-
fi

0 commit comments

Comments
 (0)