release.yml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. name: Release
  2. on:
  3. push:
  4. tags:
  5. - "*"
  6. jobs:
  7. trigger-buildkite-pipeline:
  8. if: github.repository == 'anza-xyz/agave'
  9. runs-on: ubuntu-latest
  10. steps:
  11. - name: Trigger a Buildkite Build
  12. uses: "buildkite/trigger-pipeline-action@v2.4.1"
  13. with:
  14. buildkite_api_access_token: ${{ secrets.TRIGGER_BK_BUILD_TOKEN }}
  15. pipeline: "anza/agave-secondary"
  16. branch: "${{ github.ref_name }}"
  17. build_env_vars: '{"TRIGGERED_BUILDKITE_TAG": "${{ github.ref_name }}"}'
  18. commit: "HEAD"
  19. message: ":github: Triggered from a GitHub Action"
  20. draft-release:
  21. if: github.repository == 'anza-xyz/agave'
  22. runs-on: ubuntu-latest
  23. steps:
  24. - name: Create Release
  25. uses: actions/github-script@v8
  26. with:
  27. github-token: ${{ secrets.GITHUB_TOKEN }}
  28. script: |
  29. github.rest.repos.createRelease({
  30. owner: context.repo.owner,
  31. repo: context.repo.repo,
  32. tag_name: '${{ github.ref_name }}',
  33. name: 'Release ${{ github.ref_name }}',
  34. body: '🚧',
  35. draft: false,
  36. prerelease: true
  37. })
  38. version-bump:
  39. if: github.repository == 'anza-xyz/agave'
  40. runs-on: ubuntu-latest
  41. steps:
  42. - name: Checkout code
  43. uses: actions/checkout@v6
  44. with:
  45. fetch-depth: 0
  46. token: ${{ secrets.VERSION_BUMP_PAT }}
  47. - name: Parse Info
  48. id: parse_info
  49. run: |
  50. # get the next version
  51. version=${{ github.ref_name }}
  52. major=$(echo $version | cut -d'.' -f1)
  53. minor=$(echo $version | cut -d'.' -f2)
  54. patch=$(echo $version | cut -d'.' -f3)
  55. next_version=$major.$minor.$((patch+1))
  56. : "${next_version:?}"
  57. # get the traget branch
  58. target_branch=$major.$minor
  59. : "${target_branch:?}"
  60. echo "next_version=$next_version" | tee -a $GITHUB_OUTPUT
  61. echo "target_branch=$target_branch" | tee -a $GITHUB_OUTPUT
  62. - name: Create branch and make changes
  63. run: |
  64. next_version=${{ steps.parse_info.outputs.next_version }}
  65. git checkout -b version-bump-$next_version
  66. ./scripts/increment-cargo-version.sh patch
  67. git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
  68. git config user.name "github-actions[bot]"
  69. git commit -am "Bump version to $next_version"
  70. git push origin version-bump-$next_version
  71. - name: Create PR
  72. uses: actions/github-script@v8
  73. with:
  74. github-token: ${{ secrets.GITHUB_TOKEN }}
  75. script: |
  76. github.rest.pulls.create({
  77. owner: context.repo.owner,
  78. repo: context.repo.repo,
  79. title: 'Bump version to ${{ steps.parse_info.outputs.next_version }}',
  80. head: 'version-bump-${{ steps.parse_info.outputs.next_version }}',
  81. base: '${{ steps.parse_info.outputs.target_branch }}'
  82. })