release.yml 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. name: release
  2. on:
  3. repository_dispatch:
  4. types: [release]
  5. schedule:
  6. # We want the release to be at 9-10am Pacific Time
  7. # We also want it to be 1 hour before the on-prem release
  8. - cron: '0 17 15 * *'
  9. jobs:
  10. release:
  11. runs-on: ubuntu-latest
  12. name: "Release a new version"
  13. steps:
  14. - id: calver
  15. if: ${{ !github.event.client_payload.version }}
  16. run: |
  17. DATE_PART=$(date +'%y.%-m')
  18. PATCH_VERSION=0
  19. while curl -sf -o /dev/null "https://api.github.com/repos/$GITHUB_REPOSITORY/git/ref/tags/$DATE_PART.$PATCH_VERSION"; do
  20. (( PATCH_VERSION++ ))
  21. done
  22. echo "::set-output name=version::"$DATE_PART.$PATCH_VERSION""
  23. - uses: actions/checkout@v2
  24. - uses: getsentry/craft@master
  25. if: ${{ !github.event.client_payload.skip_prepare }}
  26. with:
  27. action: prepare
  28. version: ${{ github.event.client_payload.version || steps.calver.outputs.version }}
  29. env:
  30. DRY_RUN: ${{ github.event.client_payload.dry_run }}
  31. GIT_COMMITTER_NAME: getsentry-bot
  32. GIT_AUTHOR_NAME: getsentry-bot
  33. EMAIL: bot@getsentry.com
  34. ZEUS_API_TOKEN: ${{ secrets.ZEUS_API_TOKEN }}
  35. - uses: getsentry/craft@master
  36. with:
  37. action: publish
  38. version: ${{ github.event.client_payload.version || steps.calver.outputs.version }}
  39. env:
  40. DRY_RUN: ${{ github.event.client_payload.dry_run }}
  41. GIT_COMMITTER_NAME: getsentry-bot
  42. GIT_AUTHOR_NAME: getsentry-bot
  43. EMAIL: bot@getsentry.com
  44. ZEUS_API_TOKEN: ${{ secrets.ZEUS_API_TOKEN }}
  45. TWINE_USERNAME: '__token__'
  46. TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
  47. DOCKER_USERNAME: 'sentrybuilder'
  48. DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
  49. - id: next-dev-version
  50. if: ${{ !github.event.client_payload.dry_run }}
  51. env:
  52. GIT_COMMITTER_NAME: getsentry-bot
  53. GIT_AUTHOR_NAME: getsentry-bot
  54. EMAIL: bot@getsentry.com
  55. run: |
  56. ./scripts/bump-version.sh '' $(date -d "$(echo '${{ github.event.client_payload.version || steps.calver.outputs.version }}' | sed -e 's/^\([0-9]\{2\}\)\.\([0-9]\{1,2\}\)\.[0-9]\+$/20\1-\2-1/') 1 month" +%y.%-m.0.dev0)
  57. git diff --quiet || git commit -anm 'meta: Bump new development version' && git push