mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-22 02:48:59 +00:00
build: build all the things (#9845)
Build packages for stdiscosrv and strelaysrv as well.
This commit is contained in:
parent
69979996d9
commit
d9ce7c3166
43
.github/workflows/build-syncthing.yaml
vendored
43
.github/workflows/build-syncthing.yaml
vendored
@ -178,10 +178,13 @@ jobs:
|
|||||||
|
|
||||||
- name: Create packages
|
- name: Create packages
|
||||||
run: |
|
run: |
|
||||||
go run build.go -goarch amd64 zip
|
$targets = 'syncthing', 'stdiscosrv', 'strelaysrv'
|
||||||
go run build.go -goarch arm zip
|
$archs = 'amd64', 'arm', 'arm64', '386'
|
||||||
go run build.go -goarch arm64 zip
|
foreach ($arch in $archs) {
|
||||||
go run build.go -goarch 386 zip
|
foreach ($tgt in $targets) {
|
||||||
|
go run build.go -goarch $arch zip $tgt
|
||||||
|
}
|
||||||
|
}
|
||||||
env:
|
env:
|
||||||
CGO_ENABLED: "0"
|
CGO_ENABLED: "0"
|
||||||
CODESIGN_SIGNTOOL: ${{ secrets.CODESIGN_SIGNTOOL }}
|
CODESIGN_SIGNTOOL: ${{ secrets.CODESIGN_SIGNTOOL }}
|
||||||
@ -193,7 +196,7 @@ jobs:
|
|||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: packages-windows
|
name: packages-windows
|
||||||
path: syncthing-windows-*.zip
|
path: "*.zip"
|
||||||
|
|
||||||
#
|
#
|
||||||
# Linux
|
# Linux
|
||||||
@ -229,7 +232,9 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
archs=$(go tool dist list | grep linux | sed 's#linux/##')
|
archs=$(go tool dist list | grep linux | sed 's#linux/##')
|
||||||
for goarch in $archs ; do
|
for goarch in $archs ; do
|
||||||
go run build.go -goarch "$goarch" tar
|
for tgt in syncthing stdiscosrv strelaysrv ; do
|
||||||
|
go run build.go -goarch "$goarch" tar "$tgt"
|
||||||
|
done
|
||||||
done
|
done
|
||||||
env:
|
env:
|
||||||
CGO_ENABLED: "0"
|
CGO_ENABLED: "0"
|
||||||
@ -239,7 +244,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: packages-linux
|
name: packages-linux
|
||||||
path: |
|
path: |
|
||||||
syncthing-linux-*.tar.gz
|
*.tar.gz
|
||||||
compat.json
|
compat.json
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -301,7 +306,9 @@ jobs:
|
|||||||
|
|
||||||
- name: Create package (amd64)
|
- name: Create package (amd64)
|
||||||
run: |
|
run: |
|
||||||
go run build.go -goarch amd64 zip
|
for tgt in syncthing stdiscosrv strelaysrv ; do
|
||||||
|
go run build.go -goarch amd64 zip "$tgt"
|
||||||
|
done
|
||||||
env:
|
env:
|
||||||
CGO_ENABLED: "1"
|
CGO_ENABLED: "1"
|
||||||
|
|
||||||
@ -315,7 +322,9 @@ jobs:
|
|||||||
go "\$@"
|
go "\$@"
|
||||||
EOT
|
EOT
|
||||||
chmod 755 xgo.sh
|
chmod 755 xgo.sh
|
||||||
go run build.go -gocmd ./xgo.sh -goarch arm64 zip
|
for tgt in syncthing stdiscosrv strelaysrv ; do
|
||||||
|
go run build.go -gocmd ./xgo.sh -goarch arm64 zip "$tgt"
|
||||||
|
done
|
||||||
env:
|
env:
|
||||||
CGO_ENABLED: "1"
|
CGO_ENABLED: "1"
|
||||||
|
|
||||||
@ -339,7 +348,7 @@ jobs:
|
|||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: packages-macos
|
name: packages-macos
|
||||||
path: syncthing-*.zip
|
path: "*.zip"
|
||||||
|
|
||||||
notarize-macos:
|
notarize-macos:
|
||||||
name: Notarize for macOS
|
name: Notarize for macOS
|
||||||
@ -359,7 +368,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
APPSTORECONNECT_API_KEY_PATH="$RUNNER_TEMP/apikey.p8"
|
APPSTORECONNECT_API_KEY_PATH="$RUNNER_TEMP/apikey.p8"
|
||||||
echo "$APPSTORECONNECT_API_KEY" | base64 -d -o "$APPSTORECONNECT_API_KEY_PATH"
|
echo "$APPSTORECONNECT_API_KEY" | base64 -d -o "$APPSTORECONNECT_API_KEY_PATH"
|
||||||
for file in syncthing-macos-*.zip ; do
|
for file in *-macos-*.zip ; do
|
||||||
xcrun notarytool submit \
|
xcrun notarytool submit \
|
||||||
-k "$APPSTORECONNECT_API_KEY_PATH" \
|
-k "$APPSTORECONNECT_API_KEY_PATH" \
|
||||||
-d "$APPSTORECONNECT_API_KEY_ID" \
|
-d "$APPSTORECONNECT_API_KEY_ID" \
|
||||||
@ -424,9 +433,11 @@ jobs:
|
|||||||
goos="${plat%/*}"
|
goos="${plat%/*}"
|
||||||
goarch="${plat#*/}"
|
goarch="${plat#*/}"
|
||||||
echo "::group ::$plat"
|
echo "::group ::$plat"
|
||||||
if ! go run build.go -goos "$goos" -goarch "$goarch" tar 2>/dev/null; then
|
for tgt in syncthing stdiscosrv strelaysrv ; do
|
||||||
echo "::warning ::Failed to build for $plat"
|
if ! go run build.go -goos "$goos" -goarch "$goarch" tar "$tgt" 2>/dev/null; then
|
||||||
|
echo "::warning ::Failed to build $tgt for $plat"
|
||||||
fi
|
fi
|
||||||
|
done
|
||||||
echo "::endgroup::"
|
echo "::endgroup::"
|
||||||
done
|
done
|
||||||
env:
|
env:
|
||||||
@ -436,7 +447,7 @@ jobs:
|
|||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: packages-other
|
name: packages-other
|
||||||
path: syncthing-*.tar.gz
|
path: "*.tar.gz"
|
||||||
|
|
||||||
#
|
#
|
||||||
# Source
|
# Source
|
||||||
@ -597,7 +608,9 @@ jobs:
|
|||||||
- name: Package for Debian
|
- name: Package for Debian
|
||||||
run: |
|
run: |
|
||||||
for arch in amd64 i386 armhf armel arm64 ; do
|
for arch in amd64 i386 armhf armel arm64 ; do
|
||||||
go run build.go -no-upgrade -installsuffix=no-upgrade -goarch "$arch" deb
|
for tgt in syncthing stdiscosrv strelaysrv ; do
|
||||||
|
go run build.go -no-upgrade -installsuffix=no-upgrade -goarch "$arch" deb "$tgt"
|
||||||
|
done
|
||||||
done
|
done
|
||||||
env:
|
env:
|
||||||
BUILD_USER: debian
|
BUILD_USER: debian
|
||||||
|
21
build.go
21
build.go
@ -86,7 +86,6 @@ var targets = map[string]target{
|
|||||||
"all": {
|
"all": {
|
||||||
// Only valid for the "build" and "install" commands as it lacks all
|
// Only valid for the "build" and "install" commands as it lacks all
|
||||||
// the archive creation stuff. buildPkgs gets filled out in init()
|
// the archive creation stuff. buildPkgs gets filled out in init()
|
||||||
tags: []string{"purego"},
|
|
||||||
},
|
},
|
||||||
"syncthing": {
|
"syncthing": {
|
||||||
// The default target for "build", "install", "tar", "zip", "deb", etc.
|
// The default target for "build", "install", "tar", "zip", "deb", etc.
|
||||||
@ -158,7 +157,6 @@ var targets = map[string]target{
|
|||||||
{src: "cmd/stdiscosrv/etc/linux-systemd/default", dst: "deb/etc/default/syncthing-discosrv", perm: 0o644},
|
{src: "cmd/stdiscosrv/etc/linux-systemd/default", dst: "deb/etc/default/syncthing-discosrv", perm: 0o644},
|
||||||
{src: "cmd/stdiscosrv/etc/firewall-ufw/stdiscosrv", dst: "deb/etc/ufw/applications.d/stdiscosrv", perm: 0o644},
|
{src: "cmd/stdiscosrv/etc/firewall-ufw/stdiscosrv", dst: "deb/etc/ufw/applications.d/stdiscosrv", perm: 0o644},
|
||||||
},
|
},
|
||||||
tags: []string{"purego"},
|
|
||||||
},
|
},
|
||||||
"strelaysrv": {
|
"strelaysrv": {
|
||||||
name: "strelaysrv",
|
name: "strelaysrv",
|
||||||
@ -190,23 +188,9 @@ var targets = map[string]target{
|
|||||||
},
|
},
|
||||||
"strelaypoolsrv": {
|
"strelaypoolsrv": {
|
||||||
name: "strelaypoolsrv",
|
name: "strelaypoolsrv",
|
||||||
debname: "syncthing-relaypoolsrv",
|
|
||||||
debdeps: []string{"libc6"},
|
|
||||||
description: "Syncthing Relay Pool Server",
|
description: "Syncthing Relay Pool Server",
|
||||||
buildPkgs: []string{"github.com/syncthing/syncthing/cmd/infra/strelaypoolsrv"},
|
buildPkgs: []string{"github.com/syncthing/syncthing/cmd/infra/strelaypoolsrv"},
|
||||||
binaryName: "strelaypoolsrv", // .exe will be added automatically for Windows builds
|
binaryName: "strelaypoolsrv",
|
||||||
archiveFiles: []archiveFile{
|
|
||||||
{src: "{{binary}}", dst: "{{binary}}", perm: 0o755},
|
|
||||||
{src: "cmd/infra/strelaypoolsrv/README.md", dst: "README.txt", perm: 0o644},
|
|
||||||
{src: "cmd/infra/strelaypoolsrv/LICENSE", dst: "LICENSE.txt", perm: 0o644},
|
|
||||||
{src: "AUTHORS", dst: "AUTHORS.txt", perm: 0o644},
|
|
||||||
},
|
|
||||||
installationFiles: []archiveFile{
|
|
||||||
{src: "{{binary}}", dst: "deb/usr/bin/{{binary}}", perm: 0o755},
|
|
||||||
{src: "cmd/infra/strelaypoolsrv/README.md", dst: "deb/usr/share/doc/syncthing-relaypoolsrv/README.txt", perm: 0o644},
|
|
||||||
{src: "cmd/infra/strelaypoolsrv/LICENSE", dst: "deb/usr/share/doc/syncthing-relaypoolsrv/LICENSE.txt", perm: 0o644},
|
|
||||||
{src: "AUTHORS", dst: "deb/usr/share/doc/syncthing-relaypoolsrv/AUTHORS.txt", perm: 0o644},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
"stupgrades": {
|
"stupgrades": {
|
||||||
name: "stupgrades",
|
name: "stupgrades",
|
||||||
@ -405,7 +389,6 @@ func parseFlags() {
|
|||||||
func test(tags []string, pkgs ...string) {
|
func test(tags []string, pkgs ...string) {
|
||||||
lazyRebuildAssets()
|
lazyRebuildAssets()
|
||||||
|
|
||||||
tags = append(tags, "purego")
|
|
||||||
args := []string{"test", "-tags", strings.Join(tags, " ")}
|
args := []string{"test", "-tags", strings.Join(tags, " ")}
|
||||||
if long {
|
if long {
|
||||||
timeout = longTimeout
|
timeout = longTimeout
|
||||||
@ -439,7 +422,7 @@ func bench(tags []string, pkgs ...string) {
|
|||||||
func integration(bench bool) {
|
func integration(bench bool) {
|
||||||
lazyRebuildAssets()
|
lazyRebuildAssets()
|
||||||
args := []string{"test", "-v", "-timeout", "60m", "-tags"}
|
args := []string{"test", "-v", "-timeout", "60m", "-tags"}
|
||||||
tags := "purego,integration"
|
tags := "integration"
|
||||||
if bench {
|
if bench {
|
||||||
tags += ",benchmark"
|
tags += ",benchmark"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user