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

Commit 9be43c9

Browse files
committed
Set up nightly builds
1 parent 674da87 commit 9be43c9

File tree

3 files changed

+112
-6
lines changed

3 files changed

+112
-6
lines changed

Diff for: .ci-scripts/x86-64-unknown-linux-nightly.bash

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#!/bin/bash
2+
3+
API_KEY=$1
4+
if [[ ${API_KEY} == "" ]]
5+
then
6+
echo "API_KEY needs to be supplied as first script argument."
7+
exit 1
8+
fi
9+
10+
TODAY=$(date +%Y%m%d)
11+
12+
# Compiler target parameters
13+
ARCH=x86-64
14+
15+
# Triple construction
16+
VENDOR=unknown
17+
OS=linux
18+
TRIPLE=${ARCH}-${VENDOR}-${OS}
19+
20+
# Build parameters
21+
BUILD_PREFIX=$(mktemp -d)
22+
STABLE_VERSION="nightly-${TODAY}"
23+
BUILD_DIR=${BUILD_PREFIX}/${STABLE_VERSION}
24+
25+
# Asset information
26+
PACKAGE_DIR=$(mktemp -d)
27+
PACKAGE=stable-${TRIPLE}
28+
29+
# Cloudsmith configuration
30+
CLOUDSMITH_VERSION=${TODAY}
31+
ASSET_OWNER=main-pony
32+
ASSET_REPO=pony-nightlies
33+
ASSET_PATH=${ASSET_OWNER}/${ASSET_REPO}
34+
ASSET_FILE=${PACKAGE_DIR}/${PACKAGE}.tar.gz
35+
ASSET_SUMMARY="Pony dependency manager"
36+
ASSET_DESCRIPTION="https://github.com/ponylang/pony-stable"
37+
38+
# Build stable installation
39+
echo "Building stable..."
40+
echo "make install prefix=${BUILD_DIR} arch=${ARCH} version=${STABLE_VERSION} link=static"
41+
make prefix=${BUILD_DIR} arch=${ARCH} version="${STABLE_VERSION}" \
42+
link=static
43+
44+
# Package it all up
45+
echo "Creating .tar.gz of stable..."
46+
pushd ${BUILD_PREFIX} || exit 1
47+
tar -cvzf ${ASSET_FILE} *
48+
popd || exit 1
49+
50+
# Ship it off to cloudsmith
51+
echo "Uploading package to cloudsmith..."
52+
cloudsmith push raw --version "${CLOUDSMITH_VERSION}" --api-key ${API_KEY} \
53+
--summary "${ASSET_SUMMARY}" --description "${ASSET_DESCRIPTION}" \
54+
${ASSET_PATH} ${ASSET_FILE}

Diff for: .circleci/config.yml

+27-3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@ orbs:
44
zulip: ponylang/[email protected]
55

66
jobs:
7+
x86-64-unknown-linux-nightly:
8+
docker:
9+
- image: ponylang/ponyc:release-alpine
10+
steps:
11+
- run: apk add --update py-pip
12+
- run: pip install cloudsmith-cli
13+
- checkout
14+
- run: bash .ci-scripts/x86-64-unknown-linux-nightly.bash ${CLOUDSMITH_API_KEY}
15+
- zulip/status:
16+
fail_only: true
17+
718
vs-ponyc-release:
819
docker:
920
- image: ponylang/ponyc:release
@@ -33,21 +44,34 @@ jobs:
3344

3445
workflows:
3546
version: 2
36-
commit:
47+
every-commit:
3748
jobs:
3849
- verify-changelog:
3950
context: org-global
4051
- vs-ponyc-release:
4152
context: org-global
53+
# 1 time test
54+
- x86-64-unknown-linux-nightly:
55+
context: org-global
4256

43-
nightly:
57+
daily-check-for-breakage:
4458
triggers:
4559
- schedule:
46-
cron: "0 0 * * *"
60+
cron: "0 3 * * *"
4761
filters:
4862
branches:
4963
only: master
5064
jobs:
5165
- vs-ponyc-master:
5266
context: org-global
5367

68+
create-and-upload-nightly-release:
69+
triggers:
70+
- schedule:
71+
cron: "0 0 * * *"
72+
filters:
73+
branches:
74+
only: master
75+
jobs:
76+
- x86-64-unknown-linux-nightly:
77+
context: org-global

Diff for: Makefile

+31-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ prefix ?= /usr/local
22
destdir ?= ${prefix}
33
config ?= release
44
arch ?=
5+
link ?= dynamic
56

67
BUILD_DIR ?= build/$(config)
78
SRC_DIR ?= stable
@@ -24,10 +25,34 @@ ifneq ($(arch),)
2425
arch_arg := --cpu $(arch)
2526
endif
2627

27-
ifneq ($(wildcard .git),)
28-
tag := $(shell cat VERSION)-$(shell git rev-parse --short HEAD)
28+
ifdef link
29+
ifeq (,$(filter $(link),static dynamic))
30+
$(error "Unknown linking strategy "$(link))
31+
endif
32+
endif
33+
34+
ifeq ($(link),static)
35+
LINK = --static
36+
else
37+
LINK =
38+
endif
39+
40+
# Default to version from `VERSION` file but allowing overridding on the
41+
# make command line like:
42+
# make version="nightly-19710702"
43+
# overridden version *should not* contain spaces or characters that aren't
44+
# legal in filesystem path names
45+
ifndef version
46+
version := $(shell cat VERSION)
47+
ifneq ($(wildcard .git),)
48+
sha := $(shell git rev-parse --short HEAD)
49+
tag := $(version)-$(sha)
50+
else
51+
tag := $(version)
52+
endif
2953
else
3054
tag := $(shell cat VERSION)
55+
tag := $(version)
3156
endif
3257

3358
SOURCE_FILES := $(shell find $(SRC_DIR) -path $(SRC_DIR)/test -prune -o -name \*.pony)
@@ -40,9 +65,12 @@ GEN_FILES = $(patsubst %.pony.in, %.pony, $(GEN_FILES_IN))
4065
sed s/%%VERSION%%/$(VERSION)/ $< > $@
4166

4267
$(binary): $(GEN_FILES) $(SOURCE_FILES) | $(BUILD_DIR)
43-
${PONYC} $(arch_arg) $(SRC_DIR) -o ${BUILD_DIR}
68+
@echo "foo"
69+
@echo "${PONYC} $(arch_arg) $(LINK) ${static_arg} $(SRC_DIR) -o ${BUILD_DIR}"
70+
${PONYC} $(arch_arg) $(LINK) ${static_arg} $(SRC_DIR) -o ${BUILD_DIR}
4471

4572
install: $(binary)
73+
@echo "install"
4674
mkdir -p $(DESTDIR)$(prefix)/bin
4775
cp $^ $(DESTDIR)$(prefix)/bin
4876

0 commit comments

Comments
 (0)