forked from UrbanCompass/Mussel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bitrise.yml
91 lines (87 loc) · 2.53 KB
/
bitrise.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
format_version: "8"
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
project_type: other
trigger_map:
- push_branch: '*'
workflow: test
- tag: '*.*.*'
workflow: release
workflows:
post-build:
steps:
- cache-push@2:
inputs:
- cache_paths: .build
pre-buld:
steps:
- activate-ssh-key@4:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- set-git-credentials@1:
run_if: .IsCI
inputs:
- git_email_address: [email protected]
- git_user_name: Mobile Infra Bot
- authenticate-host-with-netrc@0:
inputs:
- username: $MOBILE_BOT_SPEC_USER
- password: $MOBILE_BOT_SPEC_TOKEN
- host: trunk.cocoapods.org
- git-clone@6: {}
release:
before_run:
- pre-buld
after_run:
- post-build
envs:
- MUSSEL_RELEASE_DIR: $BITRISE_DEPLOY_DIR/release
- MUSSEL_VERSION: $BITRISE_GIT_TAG
steps:
- script@1:
title: Build Mussel Release
inputs:
- content: |-
#!/usr/bin/env bash
set -ex
mkdir -p $MUSSEL_RELEASE_DIR
# Build binary
swift build --product MusselServer -c release
cp .build/release/MusselServer $MUSSEL_RELEASE_DIR/MusselServer
chmod +x $MUSSEL_RELEASE_DIR/MusselServer
# Copy sources
cp -R Sources/Mussel $MUSSEL_RELEASE_DIR
# Copy scripts
cp scripts/run_server.sh $MUSSEL_RELEASE_DIR/run_server.sh
chmod +x $MUSSEL_RELEASE_DIR/run_server.sh
# Create zip for release
zip -rTyj $MUSSEL_RELEASE_DIR $BITRISE_DEPLOY_DIR
- github-release@0:
inputs:
- username: $MOBILE_BOT_GH_USER
- name: Version $BITRISE_GIT_TAG
- body: '## Release $BITRISE_GIT_TAG'
- draft: "no"
- files_to_upload: $BITRISE_DEPLOY_DIR/release.zip
- api_token: $MOBILE_BOT_GH_TOKEN
- script@1:
title: Release to Cocoapods
inputs:
- content: |-
#!/usr/bin/env bash
set -ex
# This is a temp fix because the netrc file has wrong access?
chmod 600 ~/.netrc
erb version="$BITRISE_GIT_TAG" Mussel.podspec.erb > Mussel.podspec
pod trunk push --allow-warnings
test:
before_run:
- pre-buld
after_run:
- post-build
steps:
- script@1:
title: Run Tests
inputs:
- content: |-
#!/usr/bin/env bash
set -ex
swift test