-
-
Notifications
You must be signed in to change notification settings - Fork 24
157 lines (130 loc) · 5.36 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
152
153
154
155
156
name: build
# execute this workflow automatically, but only when pushing to master
on:
push:
# branches: [ master ]
# pull_request:
# branches: [ master ]
jobs:
linux:
runs-on: ubuntu-latest
#container: debian:buster-slim
steps:
- uses: actions/checkout@v2
- name: Execute script to build linux AppImage
run: "sudo build/linux/debianWrapper.sh"
shell: bash
- uses: actions/upload-artifact@v2
with:
name: buskill-linux-x86_64
path: dist/
- name: Create dist tarball
run: |
cd dist
ARCHIVE_DIR=`ls -1 | grep buskill-lin | head -n1`
tar -cjvf "${ARCHIVE_DIR}.tbz" "${ARCHIVE_DIR}/"*
shell: bash
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.run_id }}_linux
release_name: 'Public Build Artifact: Linux ${{ github.run_id }}'
draft: false
prerelease: true
- name: Upload Release Asset
id: upload-release-asset
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_ID: ${{ steps.create_release.outputs.id }}
run: |
cd dist
RELEASE_FILE="`ls -1 | grep buskill-lin*.tbz | head -n1`"
curl --location --header "authorization: token ${GITHUB_TOKEN}" --header "Content-Type: application/x-bzip2" --data-binary "@${RELEASE_FILE}" "https://uploads.github.com/repos/${GITHUB_REPOSITORY}/releases/${RELEASE_ID}/assets?name=${RELEASE_FILE}"
# workflows can't trigger other workflows (actually, the ephemeral
# GITHUB_TOKEN is blocked from launching other workflows), so we get
# around it by using the "BusKill Bot" token
- name: Trigger cryptographic signature workflow
env:
BUSKILL_BOT_DISPATCH_TOKEN: ${{ secrets.BUSKILL_BOT_DISPATCH_TOKEN }}
run: |
curl -i --header "Authorization: Bearer ${BUSKILL_BOT_DISPATCH_TOKEN}" -d '{"event_type":"sign_release", "client_payload": {"release_id":"${{ steps.create_release.outputs.id }}"}}' https://api.github.com/repos/${GITHUB_REPOSITORY}/dispatches
shell: bash
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Execute script to .exe in Windows
run: "build/windows/buildExe.ps1"
shell: powershell -Command "& '{0}'"
- uses: actions/upload-artifact@v2
with:
name: buskill-windows-x86_64
path: dist/
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.run_id }}_windows
release_name: 'Public Build Artifact: Windows ${{ github.run_id }}'
draft: false
prerelease: true
- name: Upload Release Asset
id: upload-release-asset
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_ID: ${{ steps.create_release.outputs.id }}
run: |
set -x
cd dist
ls -lah
RELEASE_FILE="`ls -1 | grep buskill-win*.zip | head -n1`"
echo ${RELEASE_FILE}
curl --verbose --location --http1.1 --header "authorization: token ${GITHUB_TOKEN}" --header "Content-Type: application/zlib" --data-binary "@${RELEASE_FILE}" "https://uploads.github.com/repos/${GITHUB_REPOSITORY}/releases/${RELEASE_ID}/assets?name=${RELEASE_FILE}"
shell: bash
- name: Trigger cryptographic signature workflow
env:
BUSKILL_BOT_DISPATCH_TOKEN: ${{ secrets.BUSKILL_BOT_DISPATCH_TOKEN }}
run: |
curl --verbose -i --header "Authorization: Bearer ${BUSKILL_BOT_DISPATCH_TOKEN}" -d '{"event_type":"sign_release", "client_payload": {"release_id":"${{ steps.create_release.outputs.id }}"}}' https://api.github.com/repos/${GITHUB_REPOSITORY}/dispatches
shell: bash
mac:
runs-on: macos-13
steps:
- uses: actions/checkout@v2
- name: Execute script to build MacOS .dmg file
run: "build/mac/buildDmg.sh"
shell: bash
- uses: actions/upload-artifact@v2
with:
name: buskill-mac-x86_64
path: dist/
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.run_id }}_mac
release_name: 'Public Build Artifact: Mac ${{ github.run_id }}'
draft: false
prerelease: true
- name: Upload Release Asset
id: upload-release-asset
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_ID: ${{ steps.create_release.outputs.id }}
run: |
cd dist
RELEASE_FILE="`ls -1 | grep buskill-mac*.dmg | head -n1`"
curl --location --header "authorization: token ${GITHUB_TOKEN}" --header "Content-Type: application/zlib" --data-binary "@${RELEASE_FILE}" "https://uploads.github.com/repos/${GITHUB_REPOSITORY}/releases/${RELEASE_ID}/assets?name=${RELEASE_FILE}"
- name: Trigger cryptographic signature workflow
env:
BUSKILL_BOT_DISPATCH_TOKEN: ${{ secrets.BUSKILL_BOT_DISPATCH_TOKEN }}
run: |
curl -i --header "Authorization: Bearer ${BUSKILL_BOT_DISPATCH_TOKEN}" -d '{"event_type":"sign_release", "client_payload": {"release_id":"${{ steps.create_release.outputs.id }}"}}' https://api.github.com/repos/${GITHUB_REPOSITORY}/dispatches
shell: bash