Skip to content

Commit d39927b

Browse files
authored
Merge pull request #4 from oarrabi/oarrabi/local-release
Oarrabi/local release
2 parents e432d0b + 8989baf commit d39927b

File tree

7 files changed

+105
-24
lines changed

7 files changed

+105
-24
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,4 +195,5 @@ guaka-cli.xcodeproj
195195
Packages/
196196

197197
### Objective-C Patch ###
198+
.DS_STORE
198199
0

Makefile

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@ generate:
2222

2323
clean-darwin:
2424
rm -rf bin/darwin
25+
rm -rf release/darwin
2526

2627
clean-linux:
2728
rm -rf bin/linux
29+
rm -rf release/linux
2830

2931
clean:
3032
rm -rf .build
@@ -38,6 +40,7 @@ build-project-darwin:
3840
mkdir -p bin/darwin
3941
make build-project
4042
cp ./.build/debug/guaka-cli bin/darwin/guaka
43+
@echo "\nDarwin version built at bin/darwin/guaka\n"
4144

4245
build-project-linux:
4346
mkdir -p bin/linux
@@ -47,15 +50,49 @@ build-project-linux:
4750
release-darwin:
4851
bash scripts/release-darwin.sh
4952

53+
release-darwin-local:
54+
rm -rf .build
55+
make build-project-darwin
56+
bash scripts/release-darwin.sh
57+
5058
release-linux:
5159
bash scripts/release-linux.sh
5260

53-
publish-homebrew-mac:
61+
release-linux-local:
62+
rm -rf .build
63+
make clean-linux
64+
make build-project-linux
65+
66+
publish-local-darwin:
5467
bash scripts/publish-homebrew-mac.sh
5568

56-
release-and-deploy-darwin:
57-
make release-darwin
58-
make publish-homebrew-mac
69+
build-linux-docker:
70+
@echo "Runs release-linux-local inside a docker image"
71+
@echo "The built file is located at bin/linux/guaka"
72+
docker-compose run -w /work swift
73+
@echo "\nLinux version built at bin/linux/guaka\n"
74+
75+
build-all-local: clean build-linux-docker build-project-darwin
76+
@echo "Binaries built at bin/\n"
77+
78+
release-local:
79+
make build-all-local
80+
@echo "Starting the github release for version ${VERSION}/\n"
81+
bash scripts/github-release.sh
82+
83+
@echo "Upload darwin binary\n"
84+
bash scripts/release-darwin.sh
85+
86+
@echo "Upload linux binary\n"
87+
bash scripts/release-linux.sh
88+
89+
publish-local:
90+
make publish-local-darwin
91+
92+
release-publish-local:
93+
make release-local
94+
make publish-local
95+
5996

6097
release-and-deploy:
6198
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then make build-project-darwin release-darwin VERSION=${TRAVIS_TAG} GITHUB_TOKEN=${GITHUB_TOKEN} ; fi

Readme.md

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,40 @@ Read more about Guaka:
99

1010
## Installing
1111

12-
### Installing with homebrew (mac)
13-
The easies way to install guaka is using homebrew
12+
### macOS
1413

14+
You can install the Guaka generator CLI application in macOS with homebrew
15+
16+
```
17+
brew install oarrabi/tap/guaka
1518
```
16-
> brew install oarrabi/tap/guaka
19+
20+
Alternatively, you can install it using the installer script:
21+
1722
```
23+
curl https://raw.githubusercontent.com/oarrabi/Guaka-Generator/master/scripts/install.sh -sSf | bash
24+
```
25+
26+
Lastly you can install it by copying the binary from github and placing it in your path.
27+
Go to [https://github.com/oarrabi/Guaka-Generator/releases](https://github.com/oarrabi/Guaka-Generator/releases)
28+
29+
### GNU/Linux
1830

19-
### Download the prebuilt version(mac)
20-
You can get the most stable version [here](https://github.com/oarrabi/Guaka-Generator/releases)
31+
If you are on GNU/Linux you can run the installer script:
32+
33+
```
34+
curl https://raw.githubusercontent.com/oarrabi/Guaka-Generator/master/scripts/install.sh -sSf | bash
35+
```
36+
37+
Alternatively, You can install it by copying the binary from github and placing it in your path.
38+
Go to [https://github.com/oarrabi/Guaka-Generator/releases](https://github.com/oarrabi/Guaka-Generator/releases)
2139

2240
### Build from source
2341

2442
- Clone the repo
2543
- Run `make build-project` this generates `bin/guaka`
2644
- Copy `bin/guaka` to your bin folder
2745

28-
## Todo
29-
30-
- [ ] add unix stable builds
31-
- [ ] Add buil from source instructions for linux
32-
3346
## Contributing
3447

3548
Just send a PR! We don't bite ;)

docker-compose.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
swift:
2+
image: swiftdocker/swift
3+
volumes:
4+
- .:/work
5+
environment:
6+
PWD: /work
7+
command: make release-linux-local

scripts/github-release.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[ -z ${VERSION+x} ] && { echo "VERSION is missing"; exit 1; }
2+
[ -z ${GITHUB_TOKEN+x} ] && { echo "GITHUB_TOKEN is missing"; exit 1; }
3+
4+
github-release release --user oarrabi --security-token ${GITHUB_TOKEN} --repo Guaka-Generator --tag ${VERSION} --name "Version ${VERSION}"

scripts/publish-homebrew-mac.sh

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,37 @@
1-
if [ -z "$VERSION" ]; then
2-
echo "VERSION is missing"
1+
[ -z ${VERSION+x} ] && { echo "VERSION is missing"; exit 1; }
2+
3+
FOLDER=guaka-generator-${VERSION}-darwin-X64
4+
FILE=${FOLDER}.tar.bz2
5+
6+
if [ ! -f release/${FOLDER}/${FILE} ]; then
7+
echo "
8+
release/${FOLDER}/${FILE} not found!
9+
"
310
exit 1
411
fi
512

6-
SHA=$(shasum -a 256 bin/darwin/guaka | cut -f 1 -d " ")
13+
BRANCH="releasing-${VERSION}"
14+
SHA=$(shasum -a 256 release/${FOLDER}/${FILE} | cut -f 1 -d " ")
715
echo $SHA
816

917
cd /tmp
10-
git clone https://github.com/oarrabi/homebrew-tap.git
18+
git clone git@github.com:oarrabi/homebrew-tap.git
1119
cd homebrew-tap
12-
sed -i.bak s/"sha256 \".*\""/"sha256 \"${SHA}\""/g guaka.rb
13-
sed -i.bak s/"version \".*\""/"version \"${VERSION}\""/g guaka.rb
20+
git checkout -b ${BRANCH}
21+
22+
echo "class Guaka < Formula" > guaka.rb
23+
echo " url \"https://github.com/oarrabi/Guaka-Generator/releases/download/${VERSION}/${FILE}\"" >> guaka.rb
24+
echo " version \"${VERSION}\"" >> guaka.rb
25+
echo " sha256 \"${SHA}\" " >> guaka.rb
26+
echo "" >> guaka.rb
27+
echo " def install" >> guaka.rb
28+
echo " bin.install \"guaka\"" >> guaka.rb
29+
echo " end" >> guaka.rb
30+
echo "end" >> guaka.rb
31+
1432
git add guaka.rb
1533
git commit -m "Releasing Guaka-Generator version ${VERSION}"
34+
git push origin ${BRANCH}
35+
36+
hub pull-request -m "Releasing Guaka-Generator version ${VERSION}"
1637
rm -rf /tmp/homebrew-tap

scripts/release-common.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
# $3 binary to be released.
55

66
build_tarball() {
7-
RELEASE_DIR=/tmp/$2
7+
RELEASE_DIR=${PWD}/release/$2
88
rm -rf $RELEASE_DIR
99
mkdir -p $RELEASE_DIR
10-
mv $3 $RELEASE_DIR/
10+
cp $3 $RELEASE_DIR/
1111
RELEASE_TARBALL=$2.tar.bz2
1212
cd $RELEASE_DIR && tar -cjSf $RELEASE_TARBALL guaka
1313
RELEASE_TARBALL_PATH=$RELEASE_DIR/$RELEASE_TARBALL
@@ -30,8 +30,6 @@ release() {
3030
RELEASE_TARBALL=$RELEASE.tar.bz2
3131

3232
build_tarball RELEASE_TARBALL_PATH $RELEASE $BINARY
33-
34-
github-release release --user oarrabi --security-token ${GITHUB_TOKEN} --repo Guaka-Generator --tag ${VERSION} --name "Version ${VERSION}"
3533
github-release upload --user oarrabi --security-token ${GITHUB_TOKEN} --repo Guaka-Generator --tag ${VERSION} --name $RELEASE_TARBALL --file $RELEASE_TARBALL_PATH
3634
}
3735

0 commit comments

Comments
 (0)