forked from probonopd/static-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (49 loc) · 1.54 KB
/
build.yaml
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
name: build
on:
push:
branches:
- "master"
pull_request:
# This ensures that jobs get canceled when force-pushing
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# The default Debian shell (dash) is faster than bash at running scripts,
# and using bash when it is not needed doesn't make sense.
defaults:
run:
shell: sh
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
arch: [aarch64, armv7, i686, x86_64]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build
uses: lalten/run-on-arch-action@amd64-support # should be switched to `uraimo/run-on-arch-action@v2` when https://github.com/uraimo/run-on-arch-action/pull/94 is merged
with:
arch: ${{ matrix.arch }}
distro: alpine_latest
dockerRunArgs: |
--volume "${PWD}/out:/out"
run: ./build.sh
- name: Upload Build Artifacts
uses: actions/upload-artifact@v3
with:
name: artifacts
path: ./out/*
- name: Create Release
if: github.event_name != 'pull_request' && github.ref_name == 'master'
run: |
VERSION="$(date --utc +%Y-%m-%d)-$(git rev-parse --short HEAD)"
TAG="build-${VERSION}"
if gh release view "${TAG}" > /dev/null; then
gh release upload "${TAG}" out/*
else
gh release create --prerelease --title "Build ${VERSION}" "${TAG}" out/*
fi