This repository has been archived by the owner on Nov 30, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rockfile
56 lines (55 loc) · 2.21 KB
/
Rockfile
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
name: Rock
url: https://github.com/vknabel/Rock
version: 0.3.1
# Dependencies may be installed locally by running `rock install`
# If you like you can even delcare Specs inline or override specific scripts.
dependencies:
- swiftlint@0.15.0
- sourcery@0.5.2
# Scripts can be run as `rock run hello`
# If you are using a SwiftPM Project, the scripts build, test, install and clean will be inferred.
# Like everywhere in this Rockfile, you can use Stencil syntax inside your script values.
# Before each script is executed, it's pre variant will be executed.
# Once a script finshes, it's post variant is called.
# Searching for script ideas? Why not try write docs or publish scripts?
scripts:
# build, test, install and clean are inferred
xcode:
# Generate Project. Optionally: customize
- swift package generate-xcodeproj --enable-code-coverage
postxcode: # Will automatically run after xcode
- open {{name}}.xcodeproj
generate:
# Injects version into `RockLib` and `rock`
- sourcery Sources/RockLib/Generating Templates/RockLib Sources/RockLib/Generated/Version.generated.swift --args version={{version}}
# Sets the version for the Swift Installer
- sourcery Sources/RockLib/Generating Templates/Install Scripts/Install.generated.swift --args version={{version}}
lint:
- swiftlint autocorrect
- swiftlint
prepublish:
- rock run generate
# Run your linter before publishing
- rock lint
# Releases may only be made on branch master
- |
if [ $(git branch | grep \* | cut -d ' ' -f2) != "master" ]; then
echo Releases must be created from branch master >&2
exit 1
fi
publish: # Will automatically run prepublish
# Assert clean working directory
- git diff --exit-code > /dev/null
# Set git tag
- git tag -a {{version}} -m {{version}}
- git push --tags
postpublish:
# Copy latest Changelog
- sed -n /'^## {{version}}$'/,/'^## '/p CHANGELOG.md | sed -e '$ d' | pbcopy
# Create new release on Github
- open {{url}}/releases/new?tag={{version}}
# Publish to CocoaPods
- |
if [ -a {{name}}.podspec ]; then
bundle exec pod trunk push {{name}}.podspec --allow-warnings --swift-version=3.0
fi