-
-
Notifications
You must be signed in to change notification settings - Fork 0
157 lines (135 loc) · 4.83 KB
/
Copy pathrelease.yml
File metadata and controls
157 lines (135 loc) · 4.83 KB
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
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
build-linux:
strategy:
matrix:
include:
- arch: amd64
runner: ubuntu-latest
- arch: arm64
runner: ubuntu-24.04-arm
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Docker image with FFmpeg 8
run: |
docker build -f Dockerfile.build -t reels-builder .
- name: Build binary in container
run: |
VERSION=${GITHUB_REF_NAME#v}
docker run --rm -v ${{ github.workspace }}:/app reels-builder \
go build -buildvcs=false -ldflags "-s -w -X main.Version=$VERSION" -o reels-linux-${{ matrix.arch }} .
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: reels-linux-${{ matrix.arch }}
path: reels-linux-${{ matrix.arch }}
build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25'
- name: Install build tools
run: |
brew install meson nasm
- name: Build dav1d 1.5.1 (static)
run: |
git clone --depth 1 --branch 1.5.1 https://code.videolan.org/videolan/dav1d.git /tmp/dav1d
cd /tmp/dav1d
meson setup build --default-library=static --prefix=/usr/local \
--buildtype=release -Denable_tools=false -Denable_tests=false
ninja -C build
sudo ninja -C build install
- name: Build FFmpeg 8.0.1 (static, decode-only, minimal)
run: |
curl -sL https://ffmpeg.org/releases/ffmpeg-8.0.1.tar.xz -o /tmp/ffmpeg-8.0.1.tar.xz
tar xf /tmp/ffmpeg-8.0.1.tar.xz -C /tmp
cd /tmp/ffmpeg-8.0.1
./configure \
--prefix=/usr/local \
--enable-gpl \
--enable-version3 \
--enable-libdav1d \
--enable-static \
--disable-shared \
--disable-doc \
--disable-debug \
--disable-programs \
--disable-encoders \
--disable-muxers \
--disable-devices \
--disable-filters \
--enable-filter=aresample \
--enable-filter=scale \
--enable-filter=null \
--enable-filter=anull \
--disable-network \
--disable-autodetect \
--enable-pthreads \
--enable-zlib
make -j$(sysctl -n hw.ncpu)
sudo make install
- name: Build
env:
CGO_ENABLED: 1
PKG_CONFIG_PATH: /usr/local/lib/pkgconfig
CGO_CFLAGS: "-I/usr/local/include"
CGO_LDFLAGS: "-L/usr/local/lib -lavdevice -lavformat -lavcodec -ldav1d -lz -lavfilter -lm -lswscale -lswresample -lavutil -pthread"
run: |
VERSION=${GITHUB_REF_NAME#v}
go build -ldflags "-s -w -X main.Version=$VERSION" -o reels-darwin-arm64 .
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: reels-darwin-arm64
path: reels-darwin-arm64
release:
needs: [build-linux, build-macos]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Create source tarball
run: |
git archive --format=tar.gz --prefix=reels-${GITHUB_REF_NAME#v}/ HEAD > artifacts/reels-${GITHUB_REF_NAME#v}.tar.gz
- name: Extract changelog
id: changelog
run: |
VERSION=${GITHUB_REF_NAME#v}
# Extract the section for this version (between its heading and the next heading)
BODY=$(awk "/^## \\[${VERSION}\\]/{found=1; next} /^## \\[/{if(found) exit} found{print}" CHANGELOG.md)
# Fall back to auto-generated notes if no changelog entry exists
if [ -z "$BODY" ]; then
echo "found=false" >> $GITHUB_OUTPUT
else
echo "found=true" >> $GITHUB_OUTPUT
{
echo "body<<EOF"
echo "$BODY"
echo "EOF"
} >> $GITHUB_OUTPUT
fi
- name: Create release
uses: softprops/action-gh-release@v1
with:
files: |
artifacts/reels-linux-amd64/reels-linux-amd64
artifacts/reels-linux-arm64/reels-linux-arm64
artifacts/reels-darwin-arm64/reels-darwin-arm64
artifacts/reels-*.tar.gz
body: ${{ steps.changelog.outputs.found == 'true' && steps.changelog.outputs.body || '' }}
generate_release_notes: ${{ steps.changelog.outputs.found != 'true' }}