-
Notifications
You must be signed in to change notification settings - Fork 11
161 lines (140 loc) · 5.24 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
157
158
159
160
161
name: 'Build'
on:
push:
tags:
- '*'
jobs:
build-linux-x86:
runs-on: [self-hosted, FlipperZeroToolchain, Linux, X64]
steps:
- name: 'Wipe workspace'
run: find ./ -mount -maxdepth 1 -exec rm -rf {} \;
- name: 'Checkout code'
uses: actions/checkout@v4
with:
fetch-depth: 1
ref: ${{ github.event.pull_request.head.sha }}
- name: 'Set image tag and name'
id: tag
run: |
IMAGE_TAG="0"
if [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
REF=${{ github.ref }};
TAG_FULL=${REF#refs/*/};
IMAGE_TAG=${TAG_FULL//\//_};
fi
echo "IMAGE_TAG=${IMAGE_TAG}" >> $GITHUB_ENV
echo "image_tag=${IMAGE_TAG}" >> $GITHUB_OUTPUT
- name: 'Build linux toolchain x86_64'
run: |
docker build -t flipperzero-toolchain-linux:${IMAGE_TAG} -f linux/Dockerfile-x86_64 linux
- name: 'Bundle and upload linux toolchain x86_64'
#if: ${{ steps.tag.outputs.image_tag != '0' }}
run: |
docker run --rm \
-e "TOOLCHAIN_VERSION=$IMAGE_TAG" \
-e "INDEXER_URL=${{ secrets.INDEXER_URL }}" \
-e "INDEXER_TOKEN=${{ secrets.INDEXER_TOKEN }}" \
flipperzero-toolchain-linux:${IMAGE_TAG} \
/usr/bin/bundle_upload.sh
build-linux-aarch64:
runs-on: [self-hosted, macOS, ARM64, FlipperZeroToolchain]
steps:
- name: 'Wipe workspace'
run: find ./ -mount -maxdepth 1 -exec rm -rf {} \;
- name: 'Checkout code'
uses: actions/checkout@v4
with:
fetch-depth: 1
ref: ${{ github.event.pull_request.head.sha }}
- name: 'Set image tag and name'
id: tag
run: |
IMAGE_TAG="0"
if [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
REF=${{ github.ref }};
TAG_FULL=${REF#refs/*/};
IMAGE_TAG=${TAG_FULL//\//_};
fi
echo "IMAGE_TAG=${IMAGE_TAG}" >> $GITHUB_ENV
echo "image_tag=${IMAGE_TAG}" >> $GITHUB_OUTPUT
- name: 'Build linux toolchain aarch64'
run: |
docker build --platform linux/arm64 \
-t flipperzero-toolchain-linux:${IMAGE_TAG} \
-f linux/Dockerfile-aarch64 linux
- name: 'Bundle and upload linux toolchain aarch64'
#if: ${{ steps.tag.outputs.image_tag != '0' }}
run: |
docker run --rm \
-e "TOOLCHAIN_VERSION=$IMAGE_TAG" \
-e "INDEXER_URL=${{ secrets.INDEXER_URL }}" \
-e "INDEXER_TOKEN=${{ secrets.INDEXER_TOKEN }}" \
flipperzero-toolchain-linux:${IMAGE_TAG} \
/usr/bin/bundle_upload.sh
build-windows:
runs-on: [self-hosted, FlipperZeroToolchain, Linux, X64]
steps:
- name: 'Wipe workspace'
run: find ./ -mount -maxdepth 1 -exec rm -rf {} \;
- name: 'Checkout code'
uses: actions/checkout@v4
with:
fetch-depth: 1
ref: ${{ github.event.pull_request.head.sha }}
- name: 'Set image tag and name'
id: tag
run: |
IMAGE_TAG="0"
if [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
REF=${{ github.ref }};
TAG_FULL=${REF#refs/*/};
IMAGE_TAG=${TAG_FULL//\//_};
fi
echo "IMAGE_TAG=${IMAGE_TAG}" >> $GITHUB_ENV
echo "image_tag=${IMAGE_TAG}" >> $GITHUB_OUTPUT
- name: 'Build windows toolchain'
run: |
docker build -t flipperzero-toolchain-windows:${IMAGE_TAG} windows
- name: 'Bundle and upload windows toolchain'
#if: ${{ steps.tag.outputs.image_tag != '0' }}
run: |
docker run --rm \
-e "TOOLCHAIN_VERSION=$IMAGE_TAG" \
-e "INDEXER_URL=${{ secrets.INDEXER_URL }}" \
-e "INDEXER_TOKEN=${{ secrets.INDEXER_TOKEN }}" \
flipperzero-toolchain-windows:${IMAGE_TAG} \
/usr/bin/bundle_upload.sh
build-mac:
runs-on: [self-hosted, macOS, ARM64, FlipperZeroToolchainChmocker]
steps:
- name: 'Wipe workspace'
run: find ./ -mount -maxdepth 1 -exec rm -rf {} \;
- name: 'Checkout code'
uses: actions/checkout@v4
with:
fetch-depth: 1
ref: ${{ github.event.pull_request.head.sha }}
- name: 'Set image tag and name'
id: tag
run: |
IMAGE_TAG="0"
if [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
REF=${{ github.ref }};
TAG_FULL=${REF#refs/*/};
IMAGE_TAG=${TAG_FULL//\//_};
fi
echo "IMAGE_TAG=${IMAGE_TAG}" >> $GITHUB_ENV
echo "image_tag=${IMAGE_TAG}" >> $GITHUB_OUTPUT
#- name: 'Build mac toolchain'
# run: |
# sudo chmocker build -t flipperzero-toolchain-mac:${IMAGE_TAG} darwin
- name: 'Bundle and upload mac toolchain'
#if: ${{ steps.tag.outputs.image_tag != '0' }}
run: |
sudo chmocker run --rm \
-e "TOOLCHAIN_VERSION=$IMAGE_TAG" \
-e "INDEXER_URL=${{ secrets.INDEXER_URL }}" \
-e "INDEXER_TOKEN=${{ secrets.INDEXER_TOKEN }}" \
flipperzero-toolchain-mac:${IMAGE_TAG} \
/usr/bin/bundle_upload.sh