Skip to content
This repository was archived by the owner on Oct 25, 2021. It is now read-only.

Commit d55a275

Browse files
committed
Add Automated Builds With Drone
1 parent e69af89 commit d55a275

File tree

1 file changed

+194
-0
lines changed

1 file changed

+194
-0
lines changed

.drone.yml

Lines changed: 194 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,194 @@
1+
---
2+
kind: pipeline
3+
name: linux
4+
5+
steps:
6+
- name: build
7+
image: rust:1.35
8+
commands:
9+
- apt-get update
10+
- >
11+
apt-get install -y gcc pkg-config openssl libasound2-dev cmake
12+
build-essential libfreetype6-dev libexpat1-dev
13+
libxcb-composite0-dev libssl-dev
14+
- cargo build --release
15+
- mkdir evolution-island
16+
- mv target/release/evolution-island evolution-island
17+
- cp -R resources evolution-island
18+
- tar -czf evoli-linux-x86_64.tgz evolution-island
19+
20+
# Publish draft to GitHub releases
21+
- name: publish-draft
22+
image: plugins/github-release
23+
depends_on:
24+
- build
25+
settings:
26+
title: release-draft-linux
27+
api_key:
28+
from_secret: github_access_key
29+
files:
30+
- evoli-linux-x86_64.tgz
31+
draft: true
32+
when:
33+
ref:
34+
- refs/tags/release-draft
35+
36+
# Publish release to GitHub releases
37+
- name: publish-release
38+
image: plugins/github-release
39+
depends_on:
40+
- build
41+
settings:
42+
api_key:
43+
from_secret: github_access_key
44+
files:
45+
- evoli-linux-x86_64.tgz
46+
when:
47+
ref:
48+
- refs/tags/v*
49+
50+
trigger:
51+
branch:
52+
exclude:
53+
- feature/*
54+
55+
---
56+
kind: pipeline
57+
name: windows
58+
59+
steps:
60+
61+
# Build Arsenal runtime for Windows
62+
- name: build
63+
image: rust:1.35
64+
commands:
65+
- apt-get update
66+
- >
67+
apt-get install -y gcc gcc-mingw-w64 pkg-config openssl libasound2-dev
68+
cmake build-essential libfreetype6-dev libexpat1-dev
69+
libxcb-composite0-dev libssl-dev zip
70+
- rustup target install x86_64-pc-windows-gnu
71+
- mkdir -p .cargo
72+
- |
73+
echo '[target.x86_64-pc-windows-gnu]
74+
linker = "x86_64-w64-mingw32-gcc"' >> .cargo/config
75+
- cargo build --target x86_64-pc-windows-gnu --release
76+
- mkdir evolution-island
77+
- mv target/x86_64-pc-windows-gnu/release/evolution-island.exe evolution-island
78+
- cp -R resources evolution-island
79+
- zip -r evoli-windows-x86_64.zip evolution-island
80+
81+
# Publish draft to GitHub releases
82+
- name: publish-draft
83+
image: plugins/github-release
84+
depends_on:
85+
- build
86+
settings:
87+
title: release-draft-windows
88+
api_key:
89+
from_secret: github_access_key
90+
files:
91+
- evoli-windows-x86_64.zip
92+
draft: true
93+
when:
94+
ref:
95+
- refs/tags/release-draft
96+
97+
# Publish release to GitHub releases
98+
- name: publish-release
99+
image: plugins/github-release
100+
depends_on:
101+
- build
102+
settings:
103+
api_key:
104+
from_secret: github_access_key
105+
files:
106+
- evoli-windows-x86_64.zip
107+
when:
108+
ref:
109+
- refs/tags/v*
110+
111+
trigger:
112+
branch:
113+
exclude:
114+
- feature/*
115+
116+
---
117+
kind: pipeline
118+
name: macos
119+
120+
steps:
121+
122+
- name: build
123+
image: rust:1.35
124+
commands:
125+
# Install Cross-compiler toolchain
126+
- apt-get update
127+
- apt-get install -y clang cmake cpio make libssl-dev lzma-dev libxml2-dev
128+
- rustup target add x86_64-apple-darwin
129+
- mkdir -p /build
130+
- cd /build
131+
- git clone --depth 1 https://github.com/tpoechtrager/osxcross.git
132+
- cd /build/osxcross/tarballs
133+
- wget https://s3.dockerproject.org/darwin/v2/MacOSX10.11.sdk.tar.xz
134+
- cd /build/osxcross
135+
- UNATTENDED=yes OSX_VERSION_MIN=10.7 ./build.sh
136+
- export PATH="$PATH:/build/osxcross/target/bin"
137+
- ln -s /build/osxcross/target/SDK/MacOSX10.11.sdk/System/ /System
138+
# Configure build to use Mac linker and libraries
139+
- mkdir -p /drone/src/.cargo
140+
- |
141+
echo '[target.x86_64-apple-darwin]
142+
linker = "x86_64-apple-darwin15-clang"' >> /drone/src/.cargo/config
143+
- cd /drone/src
144+
- echo "[replace]" >> Cargo.toml # Patch coreaudio-sys so that it can be cross-compiled on Linux
145+
- >
146+
echo '"coreaudio-sys:0.2.2" =
147+
{ git = "https://github.com/zicklag/coreaudio-sys.git",
148+
branch = "feature/support-linux-cross-compiling" }' >> Cargo.toml
149+
- cargo update # WARNING: This is required because of our [replace] config above, but will potentially update dependencies.
150+
- export COREAUDIO_FRAMEWORKS_PATH='/System/Library/Frameworks'
151+
- >
152+
export COREAUDIO_CFLAGS='-I/System/Library/Frameworks/Kernel.framework/Headers
153+
-I/build/osxcross/target/SDK/MacOSX10.11.sdk/usr/include'
154+
- export CC=x86_64-apple-darwin15-clang
155+
- cargo build --target x86_64-apple-darwin --release
156+
- mkdir evolution-island
157+
- mv target/x86_64-apple-darwin/release/evolution-island evolution-island
158+
- cp -R resources evolution-island
159+
- tar -czf evoli-mac-x86_64.tgz evolution-island
160+
161+
# Publish draft to GitHub releases
162+
- name: publish-draft
163+
image: plugins/github-release
164+
depends_on:
165+
- build
166+
settings:
167+
title: release-draft-mac
168+
api_key:
169+
from_secret: github_access_key
170+
files:
171+
- evoli-mac-x86_64.tgz
172+
draft: true
173+
when:
174+
ref:
175+
- refs/tags/release-draft
176+
177+
# Publish release to GitHub releases
178+
- name: publish-release
179+
image: plugins/github-release
180+
depends_on:
181+
- build
182+
settings:
183+
api_key:
184+
from_secret: github_access_key
185+
files:
186+
- evoli-mac-x86_64.tgz
187+
when:
188+
ref:
189+
- refs/tags/v*
190+
191+
trigger:
192+
branch:
193+
exclude:
194+
- feature/*

0 commit comments

Comments
 (0)