Skip to content
This repository was archived by the owner on Aug 13, 2025. It is now read-only.

Commit 00eb8cd

Browse files
authored
Merge pull request #76 from apache/clone-dist
Create distributions with git clone
2 parents ac96d21 + 946fd38 commit 00eb8cd

File tree

1 file changed

+13
-23
lines changed

1 file changed

+13
-23
lines changed

Makefile

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,6 @@
1010
# License for the specific language governing permissions and limitations under
1111
# the License.
1212

13-
# Determine the version identifier from lerna.json or git.
14-
15-
# Are we in a release?
16-
in_release = $(shell if [ ! -d .git ]; then echo true; fi)
17-
18-
ifeq ($(in_release), true)
19-
20-
# Get the version information from lerna.json.
21-
annotator_vsn = $(shell jq -r .version < lerna.json)
22-
23-
else
24-
25-
# Get the version information from git.
26-
2713
# What is the prerelease version?
2814
vsn_pre = $(shell git describe --tags --always --first-parent \
2915
| grep -Eo -- '(-rc\.[0-9]+)?$$' \
@@ -43,9 +29,6 @@ vsn_tag = $(shell git describe --tags --always --first-parent \
4329

4430
annotator_vsn = $(vsn_rel)
4531

46-
endif
47-
48-
4932
.PHONY: all
5033
all: build
5134

@@ -71,17 +54,24 @@ else
7154

7255
.PHONY: dist
7356
dist:
74-
@rm -rf apache-annotator-$(annotator_vsn)$(vsn_pre)-incubating
75-
@git archive \
76-
--output apache-annotator-$(annotator_vsn)$(vsn_pre)-incubating.tar.gz \
77-
--prefix apache-annotator-$(annotator_vsn)-incubating/ \
78-
HEAD
57+
@rm -rf apache-annotator-$(annotator_vsn)-incubating
58+
@git clone \
59+
--branch v$(vsn_tag) \
60+
--config advice.detachedHead=false \
61+
--depth 1 \
62+
--quiet \
63+
file://"$(shell git rev-parse --show-toplevel)" \
64+
apache-annotator-$(annotator_vsn)-incubating
65+
@git --git-dir apache-annotator-$(annotator_vsn)-incubating/.git config \
66+
remote.origin.url https://github.com/apache/incubator-annotator.git
67+
@tar czf \
68+
apache-annotator-$(annotator_vsn)$(vsn_pre)-incubating.tar.gz \
69+
apache-annotator-$(annotator_vsn)-incubating
7970
@echo "Done: apache-annotator-$(annotator_vsn)$(vsn_pre)-incubating.tar.gz"
8071

8172
endif
8273

8374
.PHONY: distcheck
84-
distcheck: export HUSKY_SKIP_INSTALL=1
8575
distcheck: dist
8676
@tar xzf apache-annotator-$(annotator_vsn)$(vsn_pre)-incubating.tar.gz
8777
@make -C apache-annotator-$(annotator_vsn)-incubating check

0 commit comments

Comments
 (0)