-
-
Notifications
You must be signed in to change notification settings - Fork 14
151 lines (126 loc) · 4.67 KB
/
build.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
name: Create executables
on:
push:
branches:
- main
env:
windows_zip_name: 'Carabiner_Win_x64.zip'
linux_gz_name: 'Carabiner_Linux_x64.gz'
mac_dmg_name: 'Carabiner_Mac.dmg'
mac_signing_name: "Deep Symmetry, LLC (9M6LKU948Y)"
mac_team_id: "9M6LKU948Y"
mac_notarization_user: "james@deepsymmetry.org"
initial_description: |
:construction: This is pre-release code for people who want to help test [what is going into the next release](https://github.com/Deep-Symmetry/carabiner/blob/master/CHANGELOG.md).
> Don’t download this if you aren’t comfortable testing code while it is under active development! Instead, look at the [latest release](https:///github.com/Deep-Symmetry/carabiner/releases/latest).
Please note that since it’s a snapshot release, the executables below (you may need to click to expand the Assets) will change frequently—whenever new code is pushed to the project—so you will want to _download the latest version every time you work with one_.
jobs:
build_windows:
name: Build Windows executable
runs-on: windows-2019
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v1
- uses: Deep-Symmetry/github-version-action@v1
with:
tag-var-name: release_tag
- name: Determine snapshot status
run: |
If ($env:release_tag -like '*-SNAPSHOT') {
echo "release_snapshot=true" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
} Else {
echo "release_snapshot=false" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
}
- name: Compile and zip executable
run: |
git submodule update --init --recursive
mkdir build
cd build
cmake -G "Visual Studio 16 2019" ..
cmake --build . --config Release
cd bin\Release
7z a $env:windows_zip_name Carabiner.exe
mv $env:windows_zip_name ..\..\..
- name: Upload Windows executable
if: success()
uses: Xotl/cool-github-releases@v1
with:
mode: update
tag_name: ${{ env.release_tag }}
isPrerelease: true
replace_assets: ${{ env.release_snapshot }}
assets: ${{ env.windows_zip_name }}
github_token: ${{ github.token }}
initial_mrkdwn: ${{ env.initial_description }}
build_mac:
name: Build macOS executable
runs-on: macos-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v1
- uses: Deep-Symmetry/github-version-action@v1
with:
tag-var-name: release_tag
- name: Determine snapshot status
run: |
if [[ $release_tag =~ .*-SNAPSHOT ]]
then
echo "release_snapshot=true" >> $GITHUB_ENV
else
echo "release_snapshot=false" >> $GITHUB_ENV
fi
- name: Build, sign, and notarize macOS disk image
env:
IDENTITY_PASSPHRASE: ${{ secrets.IDENTITY_PASSPHRASE }}
IDENTITY_P12_B64: ${{ secrets.IDENTITY_P12_B64 }}
NOTARIZATION_PW: ${{ secrets.NOTARIZATION_PW }}
run: zsh .github/scripts/build_dmg.zsh
- name: Upload macOS disk image
if: success()
uses: Xotl/cool-github-releases@v1
with:
mode: update
tag_name: ${{ env.release_tag }}
isPrerelease: true
replace_assets: ${{ env.release_snapshot }}
assets: ${{ env.mac_dmg_name }}
github_token: ${{ github.token }}
initial_mrkdwn: ${{ env.initial_description }}
build_linux:
name: Build Linux x64 executable
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v1
- uses: Deep-Symmetry/github-version-action@v1
with:
tag-var-name: release_tag
- name: Determine snapshot status
run: |
if [[ $release_tag =~ .*-SNAPSHOT ]]
then
echo "release_snapshot=true" >> $GITHUB_ENV
else
echo "release_snapshot=false" >> $GITHUB_ENV
fi
- name: Compile and gzip executable
run: |
git submodule update --init --recursive
mkdir build
cd build
cmake ..
cmake --build .
cd bin
gzip Carabiner
mv Carabiner.gz ../../$linux_gz_name
- name: Upload Linux executable
if: success()
uses: Xotl/cool-github-releases@v1
with:
mode: update
tag_name: ${{ env.release_tag }}
isPrerelease: ${{ env.release_snapshot }}
replace_assets: ${{ env.release_snapshot }}
assets: ${{ env.linux_gz_name }}
github_token: ${{ github.token }}
initial_mrkdwn: ${{ env.initial_description }}