-
Notifications
You must be signed in to change notification settings - Fork 169
/
config.yml
78 lines (74 loc) · 3.51 KB
/
config.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
version: 2
jobs:
build:
working_directory: ~/alexandred/VoodooI2C
parallelism: 1
environment:
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
macos:
xcode: 11.7.0
steps:
# Machine Setup
- checkout
# Prepare for artifact and test results
- run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS
- run: xcodebuild -version
# Restore the dependency cache
- restore_cache:
keys:
# This branch if available
- v1-dep-{{ .Branch }}-
# Default branch if not
- v1-dep-master-
- run:
name: "Download the MacKernelSDK"
command: git clone https://github.com/acidanthera/MacKernelSDK
- run: src=$(/usr/bin/curl -Lfs https://raw.githubusercontent.com/acidanthera/VoodooInput/master/VoodooInput/Scripts/bootstrap.sh) && eval "$src" && mv VoodooInput Dependencies
- run: pip3 install cpplint
- run: pip3 install git+https://github.com/VoodooI2C/cldoc.git
- run: git submodule init && git submodule update
- run: xcodebuild -workspace "VoodooI2C.xcworkspace" -scheme "VoodooI2C" -derivedDataPath build clean build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO
- run: find $HOME/Library/Developer/Xcode/DerivedData -name '*.xcactivitylog' -exec cp {} $CIRCLE_ARTIFACTS/xcactivitylog \; || true
- run:
name: "Copy build artifacts"
command: |
export COMMIT_HASH=${CIRCLE_SHA1:0:7}
cd build/Build/Products/Release
zip -r $CIRCLE_ARTIFACTS/VoodooI2C-$COMMIT_HASH.zip *.kext
zip -r $CIRCLE_ARTIFACTS/VoodooI2C-Debug-Symbols-$COMMIT_HASH.zip *.dSYM
# Save artifacts
- store_artifacts:
path: /tmp/circleci-artifacts
- persist_to_workspace:
root: ./
paths:
- build/Build/Products/Release/*
- docs/*
deploy:
macos:
xcode: 11.7.0
steps:
# Machine Setup
- checkout
- attach_workspace:
at: ./
- run: brew update
- run: brew tap tcnksm/ghr
- run: brew install ghr
- run:
name: "Publish Release on GitHub"
command: export NEW_LINES=$'\n\n\n' && export LAST_TEN_COMMITS="$(git log `git describe --tags $(git rev-list --tags --max-count=1)`..HEAD --oneline --format=" - %s" | head -10)" && export NUM_COMMITS="$(git rev-list `git describe --tags $(git rev-list --tags --max-count=1)`..HEAD --count)" && cd build/Build/Products/Release && export VOODOOI2C_VERSION=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "VoodooI2C.kext/Contents/info.plist") && mkdir Archives && zip -r Archives/"VoodooI2C-$VOODOOI2C_VERSION.zip" *.kext && zip -r Archives/"VoodooI2C-Debug-Symbols-$VOODOOI2C_VERSION.zip" *.dSYM && ghr -b "Since the last release there have been $NUM_COMMITS commit(s). The descriptions for the first (at most) 10 of these are as follows $NEW_LINES $LAST_TEN_COMMITS" --username VoodooI2C --r VoodooI2C --token $GITHUB_TOKEN --soft $VOODOOI2C_VERSION Archives/
- run:
name: "Update Documentation"
command: mkdir docrepo && cp -R docs/* docrepo/ && cd docrepo && git init . && git remote add origin https://$DOCUMENTATION_TOKEN@github.com/VoodooI2C/VoodooI2C.github.io.git && git add . && git commit -m "add documentation" && git push -f --set-upstream origin master
workflows:
version: 2
build_and_release:
jobs:
- build
- deploy:
requires:
- build
filters:
branches:
only: master