mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-18 19:15:19 +00:00
build: Produce nightly release builds
This commit is contained in:
parent
dae5eab787
commit
7226b8456b
45
.github/workflows/build-syncthing.yaml
vendored
45
.github/workflows/build-syncthing.yaml
vendored
@ -459,6 +459,7 @@ jobs:
|
||||
with:
|
||||
name: packages-signed
|
||||
path: packages/*
|
||||
|
||||
#
|
||||
# Debian
|
||||
#
|
||||
@ -505,3 +506,47 @@ jobs:
|
||||
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
.github/workflows/trigger-nightly.yaml
vendored
Normal file
21
.github/workflows/trigger-nightly.yaml
vendored
Normal file
@ -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
|
@ -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
build.go
6
build.go
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user