release-syncthing.yaml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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@v4
  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@v5
  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"