1
0

release-syncthing.yaml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. name: Release Syncthing
  2. on:
  3. push:
  4. branches:
  5. - release
  6. - release-rc*
  7. permissions:
  8. contents: write
  9. jobs:
  10. create-release-tag:
  11. name: Create release tag
  12. runs-on: ubuntu-latest
  13. environment: release
  14. steps:
  15. - uses: actions/checkout@v5
  16. with:
  17. fetch-depth: 0
  18. ref: ${{ github.ref }} # https://github.com/actions/checkout/issues/882
  19. token: ${{ secrets.ACTIONS_GITHUB_TOKEN }}
  20. - uses: actions/setup-go@v6
  21. with:
  22. go-version: stable
  23. - name: Determine version to release
  24. run: |
  25. if [[ "$GITHUB_REF_NAME" == "release" ]] ; then
  26. next=$(go run ./script/next-version.go)
  27. else
  28. next=$(go run ./script/next-version.go --pre)
  29. fi
  30. echo "NEXT=$next" >> $GITHUB_ENV
  31. echo "Next version is $next"
  32. prev=$(git describe --exclude "*-*" --abbrev=0)
  33. echo "PREV=$prev" >> $GITHUB_ENV
  34. echo "Previous version is $prev"
  35. - name: Determine release notes
  36. run: |
  37. go run ./script/relnotes.go --new-ver "$NEXT" --branch "$GITHUB_REF_NAME" --prev-ver "$PREV" > notes.md
  38. env:
  39. GITHUB_TOKEN: ${{ secrets.ACTIONS_GITHUB_TOKEN }}
  40. - name: Create and push tag
  41. run: |
  42. git config --global user.name 'Syncthing Release Automation'
  43. git config --global user.email '[email protected]'
  44. git tag -a -F notes.md --cleanup=whitespace "$NEXT"
  45. git push origin "$NEXT"
  46. - name: Trigger the build
  47. uses: benc-uk/workflow-dispatch@v1
  48. with:
  49. workflow: build-syncthing.yaml
  50. ref: refs/tags/${{ env.NEXT }}
  51. token: ${{ secrets.ACTIONS_GITHUB_TOKEN }}