-
Notifications
You must be signed in to change notification settings - Fork 5
78 lines (63 loc) · 1.97 KB
/
release.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
name: Automated Releases
on:
push:
branches:
- main
tags:
- "v*"
pull_request: {}
jobs:
automated-releases:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target:
- aarch64-linux-musl
- arm-linux-musleabi
- armeb-linux-musleabi
- i686-linux-musl
- mips-linux-musl
- mipsel-linux-musl
- x86_64-linux-musl
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.target }}
cancel-in-progress: true
env:
TARGET: "${{ matrix.target }}"
OUTPUT: "output/${{ matrix.target }}/bin"
steps:
- name: Install Prerequisites
run: |
sudo apt-get install -y \
gcc g++ \
make autoconf automake libtool patch \
flex bison \
wget \
tar gzip bzip2 xz-utils
- name: Checkout Repo
uses: actions/checkout@v3
- name: Build Toolchain
run: make -w -j2 TARGET="${TARGET}" musl
- name: Build Static Binaries
run: make -w -j2 TARGET="${TARGET}" all
- name: Binary Listing
run: cd "${OUTPUT}" && ls -al "./"*
- name: Binary Types
run: cd "${OUTPUT}" && file "./"*
- name: Binary Hashes
run: cd "${OUTPUT}" && sha1sum "./"* | tee "hashes.sha1"
- name: Package Results
run: tar --strip-components=3 -czvf "${TARGET}.tar.gz" "${OUTPUT}/"*
- name: Package Hash
run: sha1sum "${TARGET}.tar.gz"
- name: Create Release
uses: softprops/action-gh-release@v1
if: github.event_name == 'push'
with:
name: ${{ github.ref_name }}
tag_name: ${{ github.ref_type == 'tag' && github.ref_name || 'latest' }}
prerelease: ${{ github.ref_type != 'tag' }}
generate_release_notes: ${{ github.ref_type == 'tag' }}
files: "${{ matrix.target }}.tar.gz"
fail_on_unmatched_files: true