aur.yml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. name: Create PR for AUR
  2. on:
  3. release:
  4. types: [published]
  5. workflow_dispatch:
  6. inputs:
  7. tag:
  8. description: 'Release tag'
  9. required: true
  10. jobs:
  11. get-version:
  12. uses: ./.github/workflows/get-version.yml
  13. with:
  14. version: ${{ inputs.tag }}
  15. tarball:
  16. name: Determines tarball url and compute checksum
  17. runs-on: ubuntu-latest
  18. needs: [get-version]
  19. if: github.event_name == 'workflow_dispatch' || needs.get-version.outputs.versionType == 'stable'
  20. outputs:
  21. url: ${{ steps.url.outputs.url}}
  22. sha256: ${{ steps.sha256.outputs.sha256}}
  23. steps:
  24. - name: Determine tarball url
  25. id: url
  26. run: |
  27. URL="";
  28. if [[ -n "${{ inputs.tag }}" ]]; then
  29. URL="https://github.com/cryptomator/cryptomator/archive/refs/tags/${{ inputs.tag }}.tar.gz"
  30. else
  31. URL="https://github.com/cryptomator/cryptomator/archive/refs/tags/${{ github.event.release.tag_name }}.tar.gz"
  32. fi
  33. echo "url=${URL}" >> "$GITHUB_OUTPUT"
  34. - name: Download source tarball and compute checksum
  35. id: sha256
  36. run: |
  37. curl --silent --fail-with-body -L -H "Accept: application/vnd.github+json" ${{ steps.url.outputs.url }} --output cryptomator.tar.gz
  38. TARBALL_SHA256=$(sha256sum cryptomator.tar.gz | cut -d ' ' -f1)
  39. echo "sha256=${TARBALL_SHA256}" >> "$GITHUB_OUTPUT"
  40. aur:
  41. name: Create PR for AUR
  42. runs-on: ubuntu-latest
  43. needs: [tarball, get-version]
  44. env:
  45. AUR_PR_URL: tbd
  46. steps:
  47. - uses: actions/checkout@v4
  48. with:
  49. repository: 'cryptomator/aur'
  50. token: ${{ secrets.CRYPTOBOT_PR_TOKEN }}
  51. - name: Install dependencies
  52. run: |
  53. sudo apt-get update
  54. sudo apt-get install makepkg pacman-package-manager
  55. - name: Checkout release branch
  56. run: |
  57. git checkout -b release/${{ needs.get-version.outputs.semVerStr }}
  58. - name: Update build file
  59. run: |
  60. sed -i -e 's|^pkgver=.*$|pkgver=${{ needs.get-version.outputs.semVerStr }}|' PKGBUILD
  61. sed -i -e 's|^pkgrel=.*$|pkgrel=1|' PKGBUILD
  62. sed -i -e "s|^sha256sums=.*$|sha256sums=('${{ needs.tarball.outputs.sha256 }}'|" PKGBUILD
  63. makepkg --printsrcinfo > .SRCINFO
  64. - name: Commit and push
  65. run: |
  66. git config user.name "${{ github.actor }}"
  67. git config user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com"
  68. git config push.autoSetupRemote true
  69. git stage .
  70. git commit -m "Prepare release ${{needs.get-version.outputs.semVerStr}}"
  71. git push
  72. - name: Create pull request
  73. run: |
  74. printf "> [!IMPORTANT]\n> Todos:\n> - [ ] Update build instructions\n> - [ ] Check for JDK update\n> - [ ] Check for JFX update" > pr_body.md
  75. PR_URL=$(gh pr create --title "Release ${{ needs.get-version.outputs.semVerStr }}" --body-file pr_body.md)
  76. echo "AUR_PR_URL=$PR_URL" >> "$GITHUB_ENV"
  77. env:
  78. GH_TOKEN: ${{ secrets.CRYPTOBOT_PR_TOKEN }}
  79. - name: Slack Notification
  80. uses: rtCamp/action-slack-notify@v2
  81. if: github.event_name == 'release'
  82. env:
  83. SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
  84. SLACK_USERNAME: 'Cryptobot'
  85. SLACK_ICON: false
  86. SLACK_ICON_EMOJI: ':bot:'
  87. SLACK_CHANNEL: 'cryptomator-desktop'
  88. SLACK_TITLE: "AUR release PR created for ${{ github.event.repository.name }} ${{ github.event.release.tag_name }} created."
  89. SLACK_MESSAGE: "See <${{ env.AUR_PR_URL }}|PR> on how to proceed."
  90. SLACK_FOOTER: false
  91. MSG_MINIMAL: true