release.yml 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. name: Create Release
  2. on:
  3. workflow_dispatch:
  4. inputs:
  5. version:
  6. description: 'version to release, e.g. v1.5.13'
  7. required: true
  8. default: 'v0.1.0'
  9. env:
  10. GHCR_USERNAME: ${{ secrets.GHCR_USERNAME }}
  11. jobs:
  12. release:
  13. name: Create Release
  14. runs-on: ubuntu-latest
  15. steps:
  16. - name: Checkout
  17. uses: actions/checkout@v2
  18. with:
  19. fetch-depth: 0
  20. - name: Create Release
  21. uses: softprops/action-gh-release@v1
  22. with:
  23. tag_name: ${{ github.event.inputs.version }}
  24. env:
  25. GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
  26. - name: Build Changelog
  27. id: build_changelog
  28. uses: mikepenz/release-changelog-builder-action@v2
  29. with:
  30. configuration: "changelog.json"
  31. toTag: ${{ github.event.inputs.version }}
  32. commitMode: true
  33. env:
  34. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  35. - name: create changelog file
  36. env:
  37. VERSION: ${{ github.event.inputs.version }}
  38. CHANGELOG: ${{ steps.build_changelog.outputs.changelog }}
  39. run: |
  40. echo "Image: \`ghcr.io/${GITHUB_REPOSITORY}:${VERSION}\`" >> .changelog
  41. echo "${CHANGELOG}" >> .changelog
  42. - name: Update Release
  43. uses: softprops/action-gh-release@v1
  44. with:
  45. tag_name: ${{ github.event.inputs.version }}
  46. body_path: .changelog
  47. env:
  48. GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
  49. - name: Update Docs
  50. run: make docs.publish DOCS_VERSION=${{ github.event.inputs.version }} DOCS_ALIAS=latest
  51. env:
  52. GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
  53. promote:
  54. name: Promote Container Image
  55. runs-on: ubuntu-latest
  56. steps:
  57. - name: Checkout
  58. uses: actions/checkout@v2
  59. with:
  60. fetch-depth: 0
  61. - name: Login to Docker
  62. uses: docker/login-action@v1
  63. if: env.GHCR_USERNAME != ''
  64. with:
  65. registry: ghcr.io
  66. username: ${{ secrets.GHCR_USERNAME }}
  67. password: ${{ secrets.GHCR_TOKEN }}
  68. - name: Promote Container Image
  69. if: env.GHCR_USERNAME != ''
  70. run: make docker.promote
  71. env:
  72. RELEASE_TAG: ${{ github.event.inputs.version }}
  73. SOURCE_TAG: main