-
Notifications
You must be signed in to change notification settings - Fork 19
95 lines (85 loc) · 2.55 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Release
on:
push:
tags: [ 'v*' ]
branches: [ 'master' ]
pull_request:
branches: [ 'master' ]
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-24.04
strategy:
matrix:
include:
- target: x86-64-linux-gnu
goarch: amd64
cc: gcc
tar: linux_x86_64
- target: arm-rpi-linux-gnueabihf
goarch: arm
cc: arm-rpi-linux-gnueabihf-gcc
tar: linux_armv6_rpi
- target: arm-linux-gnueabihf
goarch: arm
cc: arm-linux-gnueabihf-gcc
tar: linux_armv6
- target: aarch64-linux-gnu
goarch: arm64
cc: aarch64-linux-gnu-gcc
tar: linux_arm64
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: git fetch --force --tags
- name: Build image
run: |
docker build \
--build-arg TARGET=${{ matrix.target }} \
--build-arg GOARCH=${{ matrix.goarch }} \
--build-arg CC=${{ matrix.cc }} \
-t go-librespot-build-${{ matrix.target }} \
-f Dockerfile.build \
.
- name: Compile binary
run: |
mkdir -p /tmp/out
docker run --rm \
--env COMMIT=${{ github.sha }} \
--env VERSION=${{ startsWith(github.ref_name, 'v') && github.ref_name || '' }} \
-v $PWD:/src \
go-librespot-build-${{ matrix.target }}
tar -zcvf /tmp/out/go-librespot_${{ matrix.tar }}.tar.gz go-librespot README.md
- name: Upload compiled binary
uses: actions/upload-artifact@v3
with:
name: binaries
path: /tmp/out
retention-days: 7
publish:
runs-on: ubuntu-24.04
if: startsWith(github.ref, 'refs/tags/')
needs:
- build
steps:
- name: Download compiled binaries
uses: actions/download-artifact@v3
with:
name: binaries
path: /tmp/out
- name: Generate changelog
uses: jaywcjlove/changelog-generator@main
id: changelog
with:
token: ${{ secrets.GITHUB_TOKEN }}
filter-author: (dependabot|renovate\\[bot\\]|dependabot\\[bot\\]|Renovate Bot)
filter: '[R|r]elease[d]\s+[v|V]\d(\.\d+){0,2}'
- name: Release binaries
uses: softprops/action-gh-release@v1
with:
body: |
${{ steps.changelog.outputs.compareurl }}
${{ steps.changelog.outputs.changelog }}
files: /tmp/out/*