Skip to content

Commit

Permalink
Merge branch 'main' into newglobbing
Browse files Browse the repository at this point in the history
* main: (42 commits)
  all: Correct various typos (syncthing#8870)
  gui, man, authors: Update docs, translations, and contributors
  lib/model: Set platform data, incl. copying ownership, for new folders w/ NoPermissions flag (syncthing#8883)
  gui: Add Thai (th) translation template. (syncthing#8887)
  build: Produce nightly release builds
  gui, man, authors: Update docs, translations, and contributors
  build: Bump actions version; fix Node 12 deprecation warning (syncthing#8881)
  build: Build Debian packages
  build: Sign for upgrades
  build: Notarize mac builds
  build(deps): bump github.com/quic-go/quic-go from 0.33.0 to 0.34.0 (syncthing#8877)
  gui, man, authors: Update docs, translations, and contributors
  lib/ignore: Properly handle non-existing included ignore-files (fixes syncthing#8764) (syncthing#8874)
  lib/connections: Avoid using nil lanChecker
  gui, man, authors: Update docs, translations, and contributors
  lib/config, lib/connections: Configurable protocol priority (ref syncthing#8626) (syncthing#8868)
  build: Upgrade recli (fixes syncthing#8503) (syncthing#8871)
  build: Update dependencies (syncthing#8869)
  lib/model: Improve path generation for auto accepted folders (fixes syncthing#8859) (syncthing#8860)
  docs: fix typo (syncthing#8857)
  ...
  • Loading branch information
calmh committed May 9, 2023
2 parents a2e58d8 + ddce692 commit 8c282de
Show file tree
Hide file tree
Showing 137 changed files with 2,659 additions and 7,580 deletions.
198 changes: 184 additions & 14 deletions .github/workflows/build-syncthing.yaml
Expand Up @@ -57,7 +57,7 @@ jobs:
- uses: actions/checkout@v3

- uses: actions/setup-go@v3
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
cache: true
Expand All @@ -84,7 +84,7 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: actions/setup-go@v3
- uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}

Expand All @@ -98,7 +98,7 @@ jobs:

package-windows:
name: Package for Windows
if: github.event_name == 'push' && github.ref == 'refs/heads/release'
if: github.event_name == 'push' && (github.ref == 'refs/heads/release' || startsWith(github.ref, 'refs/heads/release-'))
environment: signing
needs:
- build-test
Expand All @@ -117,7 +117,7 @@ jobs:
with:
fetch-depth: 0

- uses: actions/setup-go@v3
- uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}

Expand Down Expand Up @@ -148,7 +148,7 @@ jobs:
- name: Archive artifacts
uses: actions/upload-artifact@v3
with:
name: packages
name: packages-windows
path: syncthing-windows-*.zip

#
Expand All @@ -165,7 +165,7 @@ jobs:
with:
fetch-depth: 0

- uses: actions/setup-go@v3
- uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}

Expand All @@ -188,7 +188,7 @@ jobs:
- name: Archive artifacts
uses: actions/upload-artifact@v3
with:
name: packages
name: packages-linux
path: syncthing-linux-*.tar.gz

#
Expand All @@ -197,7 +197,7 @@ jobs:

package-macos:
name: Package for macOS
if: github.event_name == 'push' && github.ref == 'refs/heads/release'
if: github.event_name == 'push' && (github.ref == 'refs/heads/release' || startsWith(github.ref, 'refs/heads/release-'))
environment: signing
needs:
- build-test
Expand All @@ -207,7 +207,7 @@ jobs:
with:
fetch-depth: 0

- uses: actions/setup-go@v3
- uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}

Expand Down Expand Up @@ -282,9 +282,38 @@ jobs:
- name: Archive artifacts
uses: actions/upload-artifact@v3
with:
name: packages
name: packages-macos
path: syncthing-*.zip

notarize-macos:
name: Notarize for macOS
if: github.event_name == 'push' && (github.ref == 'refs/heads/release' || startsWith(github.ref, 'refs/heads/release-'))
environment: signing
needs:
- package-macos
runs-on: macos-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: packages-macos

- name: Notarize binaries
run: |
APPSTORECONNECT_API_KEY_PATH="$RUNNER_TEMP/apikey.p8"
echo "$APPSTORECONNECT_API_KEY" | base64 -d -o "$APPSTORECONNECT_API_KEY_PATH"
for file in syncthing-macos-*.zip ; do
xcrun notarytool submit \
-k "$APPSTORECONNECT_API_KEY_PATH" \
-d "$APPSTORECONNECT_API_KEY_ID" \
-i "$APPSTORECONNECT_API_KEY_ISSUER" \
$file
done
env:
APPSTORECONNECT_API_KEY: ${{ secrets.APPSTORECONNECT_API_KEY }}
APPSTORECONNECT_API_KEY_ID: ${{ secrets.APPSTORECONNECT_API_KEY_ID }}
APPSTORECONNECT_API_KEY_ISSUER: ${{ secrets.APPSTORECONNECT_API_KEY_ISSUER }}

#
# Cross compile other unixes
#
Expand All @@ -299,7 +328,7 @@ jobs:
with:
fetch-depth: 0

- uses: actions/setup-go@v3
- uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}

Expand Down Expand Up @@ -338,7 +367,7 @@ jobs:
- name: Archive artifacts
uses: actions/upload-artifact@v3
with:
name: packages
name: packages-other
path: syncthing-*.tar.gz

#
Expand All @@ -355,7 +384,7 @@ jobs:
with:
fetch-depth: 0

- uses: actions/setup-go@v3
- uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}

Expand All @@ -378,5 +407,146 @@ jobs:
- name: Archive artifacts
uses: actions/upload-artifact@v3
with:
name: packages
name: packages-source
path: syncthing-source-*.tar.gz

#
# Sign binaries for auto upgrade
#

sign-for-upgrade:
name: Sign for upgrade
if: github.event_name == 'push' && (github.ref == 'refs/heads/release' || startsWith(github.ref, 'refs/heads/release-'))
environment: signing
needs:
- package-windows
- package-linux
- package-macos
- package-cross
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/checkout@v3
with:
repository: syncthing/release-tools
path: tools
fetch-depth: 0

- name: Download artifacts
uses: actions/download-artifact@v3

- name: Install signing tool
run: |
go install ./cmd/stsigtool
- name: Sign archives
run: |
export PRIVATE_KEY="$RUNNER_TEMP/privkey.pem"
export PATH="$PATH:$(go env GOPATH)/bin"
echo "$STSIGTOOL_PRIVATE_KEY" | base64 -d > "$PRIVATE_KEY"
mkdir packages
mv packages-*/* packages
pushd packages
"$GITHUB_WORKSPACE/tools/sign-only"
env:
STSIGTOOL_PRIVATE_KEY: ${{ secrets.STSIGTOOL_PRIVATE_KEY }}

- name: Archive artifacts
uses: actions/upload-artifact@v3
with:
name: packages-signed
path: packages/*

#
# Debian
#

package-debian:
name: Package for Debian
needs:
- build-test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}

- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'

- name: Install fpm
run: |
gem install fpm
- uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ env.GO_VERSION }}-debian-${{ hashFiles('**/go.sum') }}

- name: Package for Debian
run: |
for goarch in amd64 arm64 arm ; do
go run build.go -goos linux -goarch "$goarch" deb
done
env:
BUILD_USER: debian

- name: Archive artifacts
uses: actions/upload-artifact@v3
with:
name: debian-packages
path: "*.deb"

#
# Nightlies
#

publish-nightly:
name: Publish nightly build
if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads/release-nightly')
environment: signing
needs:
- sign-for-upgrade
- notarize-macos
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
repository: syncthing/release-tools
path: tools
fetch-depth: 0

- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: packages-signed
path: packages

- name: Create release json
run: |
cd packages
"$GITHUB_WORKSPACE/tools/generate-release-json" "$BASE_URL" > nightly.json
env:
BASE_URL: https://syncthing.ams3.digitaloceanspaces.com/nightly/

- name: Push artifacts
uses: docker://docker.io/rclone/rclone:latest
env:
RCLONE_CONFIG_SPACES_TYPE: s3
RCLONE_CONFIG_SPACES_PROVIDER: DigitalOcean
RCLONE_CONFIG_SPACES_ACCESS_KEY_ID: ${{ secrets.SPACES_KEY }}
RCLONE_CONFIG_SPACES_SECRET_ACCESS_KEY: ${{ secrets.SPACES_SECRET }}
RCLONE_CONFIG_SPACES_ENDPOINT: ams3.digitaloceanspaces.com
RCLONE_CONFIG_SPACES_ACL: public-read
with:
args: sync packages spaces:syncthing/nightly
21 changes: 21 additions & 0 deletions .github/workflows/trigger-nightly.yaml
@@ -0,0 +1,21 @@
name: Trigger nightly build & release
on:
workflow_dispatch:
schedule:
# Run nightly build at 01:00 UTC
- cron: '00 01 * * *'

jobs:

trigger-nightly:
runs-on: ubuntu-latest
name: Push to release-nightly to trigger build
steps:

- uses: actions/checkout@v3
with:
token: ${{ secrets.ACTIONS_GITHUB_TOKEN }}
fetch-depth: 0

- run: |
git push origin main:release-nightly
6 changes: 3 additions & 3 deletions .github/workflows/update-docs-translations.yaml
Expand Up @@ -10,13 +10,13 @@ jobs:
runs-on: ubuntu-latest
name: Update translations and documentation
steps:
- uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.ACTIONS_GITHUB_TOKEN }}
- uses: actions/setup-go@268d8c0ca0432bb2cf416faae41297df9d262d7f # v2
- uses: actions/setup-go@v4
with:
go-version: ^1.18.4
go-version: ^1.19.6
- run: |
set -euo pipefail
git config --global user.name 'Syncthing Release Automation'
Expand Down
3 changes: 3 additions & 0 deletions AUTHORS
Expand Up @@ -36,6 +36,7 @@ Andrey D (scienmind) <scintertech@cryptolab.net> <scienmind@users.noreply.github
André Colomb (acolomb) <src@andre.colomb.de> <github.com@andre.colomb.de>
andyleap <andyleap@gmail.com>
Anjan Momi <anjan@momi.ca>
Anthony Goeckner <agoeckner@users.noreply.github.com>
Antoine Lamielle (0x010C) <antoine.lamielle@0x010c.fr> <gh@0x010c.fr>
Antony Male (canton7) <antony.male@gmail.com>
Anur <anurnomeru@163.com>
Expand Down Expand Up @@ -96,6 +97,7 @@ dependabot[bot] <dependabot[bot]@users.noreply.github.com> <49699333+dependabot[
derekriemer <derek.riemer@colorado.edu>
desbma <desbma@users.noreply.github.com>
Devon G. Redekopp <devon@redekopp.com>
Dimitri Papadopoulos Orfanos <3234522+DimitriPapadopoulos@users.noreply.github.com>
Dmitry Saveliev (dsaveliev) <d.e.saveliev@gmail.com>
Domenic Horner <domenic@tgxn.net>
Dominik Heidler (asdil12) <dominik@heidler.eu>
Expand Down Expand Up @@ -166,6 +168,7 @@ Jose Manuel Delicado (jmdaweb) <jmdaweb@hotmail.com> <jmdaweb@users.noreply.gith
jtagcat <git-514635f7@jtag.cat> <git-12dbd862@jtag.cat>
Jörg Thalheim <Mic92@users.noreply.github.com>
Jędrzej Kula <kula.jedrek@gmail.com>
K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
Kalle Laine <pahakalle@protonmail.com>
Karol Różycki (krozycki) <rozycki.karol@gmail.com>
Kebin Liu <lkebin@gmail.com>
Expand Down
7 changes: 1 addition & 6 deletions Dockerfile.stupgrades
Expand Up @@ -15,9 +15,4 @@ EXPOSE 8080

COPY --from=builder /src/stupgrades /bin/stupgrades

ENTRYPOINT [ \
"/bin/stupgrades", \
"-f", "/nightly.json->https://build.syncthing.net/guestAuth/repository/download/Release_Nightly/.lastSuccessful/nightly.json", \
"-f", "/syncthing-macos/appcast.xml->https://build.syncthing.net/guestAuth/repository/download/SyncthingMacOS_CreateAppcastXml/.lastSuccessful/appcast.xml" \
]

ENTRYPOINT [ "/bin/stupgrades" ]
6 changes: 5 additions & 1 deletion build.go
Expand Up @@ -1108,10 +1108,14 @@ func getBranchSuffix() string {

branch = parts[len(parts)-1]
switch branch {
case "master", "release", "main":
case "release", "main":
// these are not special
return ""
}
if strings.HasPrefix(branch, "release-") {
// release branches are not special
return ""
}

validBranchRe := regexp.MustCompile(`^[a-zA-Z0-9_.-]+$`)
if !validBranchRe.MatchString(branch) {
Expand Down

0 comments on commit 8c282de

Please sign in to comment.