-
Notifications
You must be signed in to change notification settings - Fork 209
145 lines (127 loc) · 4.94 KB
/
goreleaser.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
name: goreleaser
on:
push:
tags:
- "*"
jobs:
macos-sdk:
runs-on: macos-latest
steps:
- id: osxcross-macos-sdk
uses: actions/cache@v4
with:
path: osxcross/tarballs
key: ${{ runner.os }}-osxcross-macos-sdk
- name: Package MacOSX SDK
if: steps.osxcross-macos-sdk.outputs.cache-hit != 'true'
run: |
git clone https://github.com/tpoechtrager/osxcross osxcross
pushd osxcross
XCODEDIR=/Applications/Xcode_16.0.app tools/gen_sdk_package.sh
mv MacOSX*.sdk.tar.xz tarballs/
popd
- uses: actions/upload-artifact@v4
with:
name: osxcross-tarballs
path: osxcross/tarballs
goreleaser:
runs-on: ubuntu-latest
container: fedora:41
needs: macos-sdk
steps:
- name: Install dependencies
run: |
dnf -y install autoconf bash clang cmake gettext-devel git glibc-{devel,static}.{i686,x86_64} golang libstdc++-static libtool libuuid-devel libxml2-devel llvm-devel make mingw{32,64}-{winpthreads,xz-libs}-static mingw{32,64}-gcc{-c++,} openssl-devel patch po4a xz-{devel,static}.{i686,x86_64}
dnf -y install 'dnf-command(download)'
dnf download --source xz-devel
rpm -ivh *.src.rpm
rm -f *.src.rpm
- name: Setup cross compile environment for Linux ARMv7
env:
CC: arm-linux-gnueabi-gcc
CXX: arm-linux-gnueabi-c++
CFLAGS: -fPIC
run: |
dnf -y copr enable lantw44/arm-linux-gnueabi-toolchain
dnf -y install arm-linux-gnueabi-{binutils,gcc,glibc}
mkdir /linux-armv7-buildroot
pushd /linux-armv7-buildroot
tar -xvf $HOME/rpmbuild/SOURCES/xz-*.tar.gz
pushd $(basename $HOME/rpmbuild/SOURCES/xz-*.tar.gz .tar.gz)
./autogen.sh
./configure --host=armv7 --prefix=/linux-armv7-buildroot/sys-root
make -j$(nproc) install
popd
popd
- name: Setup cross compile environment for Linux AArch64
env:
CC: aarch64-linux-gnu-gcc
CXX: aarch64-linux-gnu-c++
run: |
dnf -y copr enable lantw44/aarch64-linux-gnu-toolchain
dnf -y install aarch64-linux-gnu-{binutils,gcc,glibc}
mkdir /linux-aarch64-buildroot
pushd /linux-aarch64-buildroot
tar -xvf $HOME/rpmbuild/SOURCES/xz-*.tar.gz
pushd $(basename $HOME/rpmbuild/SOURCES/xz-*.tar.gz .tar.gz)
./autogen.sh
./configure --host=aarch64 --prefix=/linux-aarch64-buildroot/sys-root
make -j$(nproc) install
popd
popd
- name: Download osxcross
run: git clone https://github.com/tpoechtrager/osxcross /osxcross
- id: osxcross-target
uses: actions/cache@v4
with:
path: /osxcross/target
key: ${{ runner.os }}-osxcross-target
- uses: actions/download-artifact@v4
if: steps.osxcross-target.outputs.cache-hit != 'true'
with:
name: osxcross-tarballs
path: /osxcross/tarballs
- uses: geekyeggo/delete-artifact@v5
with:
name: osxcross-tarballs
- name: Build osxcross
if: steps.osxcross-target.outputs.cache-hit != 'true'
run: UNATTENDED=1 SDK_VERSION=15.0 ./build.sh
working-directory: /osxcross
- name: Setup cross compile environment for Darwin AMD64
env:
CC: o64-clang
CXX: o64-clang++
run: |
mkdir /darwin-amd64-buildroot
pushd /darwin-amd64-buildroot
tar -xvf $HOME/rpmbuild/SOURCES/xz-*.tar.gz
pushd $(basename $HOME/rpmbuild/SOURCES/xz-*.tar.gz .tar.gz)
PATH=/osxcross/target/bin:$PATH ./autogen.sh
PATH=/osxcross/target/bin:$PATH ./configure --host=x86_64-apple-darwin24 --prefix=/darwin-amd64-buildroot/sys-root --enable-shared=no
PATH=/osxcross/target/bin:$PATH make -j$(nproc) install
popd
popd
- name: Setup cross compile environment for Darwin AArch64
env:
CC: oa64-clang
CXX: oa64-clang++
run: |
mkdir /darwin-aarch64-buildroot
pushd /darwin-aarch64-buildroot
tar -xvf $HOME/rpmbuild/SOURCES/xz-*.tar.gz
pushd $(basename $HOME/rpmbuild/SOURCES/xz-*.tar.gz .tar.gz)
PATH=/osxcross/target/bin:$PATH ./autogen.sh
PATH=/osxcross/target/bin:$PATH ./configure --host=aarch64-apple-darwin24 --prefix=/darwin-aarch64-buildroot/sys-root --enable-shared=no
PATH=/osxcross/target/bin:$PATH make -j$(nproc) install
popd
popd
- uses: actions/checkout@v4
- name: Add $GITHUB_WORKSPACE to git safe.directory
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- uses: goreleaser/goreleaser-action@v6
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"