-
Notifications
You must be signed in to change notification settings - Fork 156
148 lines (127 loc) · 4.56 KB
/
ci.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
name: 'CI'
on: push
jobs:
build_linux:
runs-on: ubuntu-latest
steps:
- name: 'Wipe workspace'
run: find ./ -mount -maxdepth 1 -exec rm -rf {} \;
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v5
with:
push: false
context: docker
tags: qflipper-build:latest
load: true
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Build application in docker
run: docker run --rm --privileged -v $(pwd):/project qflipper-build:latest /project/build_linux.sh
- name: Publish application
uses: actions/upload-artifact@v3
with:
name: qFlipper-x86_64.AppImage
path: |
./build/qFlipper-x86_64.AppImage
if-no-files-found: error
retention-days: 1
build_mac:
runs-on: [self-hosted, ARM64, macOS, qFlipper]
env:
MAC_OS_KEYCHAIN_NAME: ${{ secrets.MAC_OS_KEYCHAIN_NAME }}
MAC_OS_KEYCHAIN_PASSWORD: ${{ secrets.MAC_OS_KEYCHAIN_PASSWORD }}
MAC_OS_SIGNING_KEY_ID: ${{ secrets.MAC_OS_SIGNING_KEY_ID }}
MAC_OS_SIGNING_BUNDLE_ID: ${{ secrets.MAC_OS_SIGNING_BUNDLE_ID }}
MAC_OS_SIGNING_ASC_PROVIDER: ${{ secrets.MAC_OS_SIGNING_ASC_PROVIDER }}
MAC_OS_SIGNING_USERNAME: ${{ secrets.MAC_OS_SIGNING_USERNAME }}
MAC_OS_SIGNING_PASSWORD: ${{ secrets.MAC_OS_SIGNING_PASSWORD }}
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true
- name: Build application
run: ./build_mac.sh
- name: Publish application
uses: actions/upload-artifact@v3
with:
name: qflipper.dmg
path: |
./build_mac/qflipper.dmg
if-no-files-found: error
retention-days: 1
build_windows:
runs-on: [self-hosted, X64, Windows]
env:
SIGNING_TOOL: ${{ secrets.WIN_SIGNING_TOOL }}
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true
- name: Build application
run: .\build_windows.bat
- name: Publish application
uses: actions/upload-artifact@v3
with:
name: qFlipperSetup-64bit.exe
path: |
.\build\qFlipperSetup-64bit.exe
.\build\qFlipper-64bit.zip
if-no-files-found: error
retention-days: 1
upload:
name: Upload apps to storage
needs: [build_windows, build_mac, build_linux]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: 'Make artifacts directory'
run: |
test -d artifacts && rm -rf artifacts || true
mkdir artifacts
- name: 'Generate tag suffix'
if: startsWith(github.ref, 'refs/tags/') == true
run: |
echo "REF=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
echo "SUFFIX=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
- name: 'Generate branch suffix'
if: startsWith(github.ref, 'refs/tags/') != true
run: |
echo "REF=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_ENV
echo "SUFFIX=$(git rev-parse --abbrev-ref HEAD | sed 's/\//_/g')-$(date +'%d%m%Y')-$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- uses: actions/download-artifact@v2
with:
name: qFlipper-x86_64.AppImage
- uses: actions/download-artifact@v2
with:
name: qFlipperSetup-64bit.exe
- uses: actions/download-artifact@v2
with:
name: qflipper.dmg
- name: Rename app
run: |
mv qFlipper-x86_64.AppImage ./artifacts/qFlipper-x86_64-${SUFFIX}.AppImage
mv qFlipperSetup-64bit.exe ./artifacts/qFlipperSetup-64bit-${SUFFIX}.exe
mv qFlipper-64bit.zip ./artifacts/qFlipper-64bit-${SUFFIX}.zip
mv qflipper.dmg ./artifacts/qFlipper-${SUFFIX}.dmg
- name: Upload artifacts to update server
if: ${{ !github.event.pull_request.head.repo.fork }}
run: |
FILES=$(for CUR in $(ls artifacts/); do echo "-F files=@artifacts/$CUR"; done)
curl --fail -L -H "Token: ${{ secrets.INDEXER_TOKEN }}" \
-F "branch=${REF}" \
${FILES[@]} \
"${{ secrets.INDEXER_URL }}"/qFlipper/uploadfiles