You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

release-tag-rc.yml 4.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. name: release-tag-rc
  2. on:
  3. push:
  4. tags:
  5. - 'v1*-rc*'
  6. concurrency:
  7. group: ${{ github.workflow }}-${{ github.ref }}
  8. cancel-in-progress: false
  9. jobs:
  10. binary:
  11. runs-on: nscloud
  12. steps:
  13. - uses: actions/checkout@v4
  14. # fetch all commits instead of only the last as some branches are long lived and could have many between versions
  15. # fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567
  16. - run: git fetch --unshallow --quiet --tags --force
  17. - uses: actions/setup-go@v4
  18. with:
  19. go-version: "~1.21"
  20. check-latest: true
  21. - uses: actions/setup-node@v3
  22. with:
  23. node-version: 20
  24. - run: make deps-frontend deps-backend
  25. # xgo build
  26. - run: make release
  27. env:
  28. TAGS: bindata sqlite sqlite_unlock_notify
  29. - name: import gpg key
  30. id: import_gpg
  31. uses: crazy-max/ghaction-import-gpg@v5
  32. with:
  33. gpg_private_key: ${{ secrets.GPGSIGN_KEY }}
  34. passphrase: ${{ secrets.GPGSIGN_PASSPHRASE }}
  35. - name: sign binaries
  36. run: |
  37. for f in dist/release/*; do
  38. echo '${{ secrets.GPGSIGN_PASSPHRASE }}' | gpg --pinentry-mode loopback --passphrase-fd 0 --batch --yes --detach-sign -u ${{ steps.import_gpg.outputs.fingerprint }} --output "$f.asc" "$f"
  39. done
  40. # clean branch name to get the folder name in S3
  41. - name: Get cleaned branch name
  42. id: clean_name
  43. run: |
  44. REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\///' -e 's/release\/v//')
  45. echo "Cleaned name is ${REF_NAME}"
  46. echo "branch=${REF_NAME}" >> "$GITHUB_OUTPUT"
  47. - name: configure aws
  48. uses: aws-actions/configure-aws-credentials@v4
  49. with:
  50. aws-region: ${{ secrets.AWS_REGION }}
  51. aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
  52. aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
  53. - name: upload binaries to s3
  54. run: |
  55. aws s3 sync dist/release s3://${{ secrets.AWS_S3_BUCKET }}/gitea/${{ steps.clean_name.outputs.branch }} --no-progress
  56. - name: create github release
  57. run: |
  58. gh release create ${{ github.ref_name }} --title ${{ github.ref_name }} --draft --notes-from-tag dist/release/*
  59. env:
  60. GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
  61. docker-rootful:
  62. runs-on: ubuntu-latest
  63. steps:
  64. - uses: actions/checkout@v4
  65. # fetch all commits instead of only the last as some branches are long lived and could have many between versions
  66. # fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567
  67. - run: git fetch --unshallow --quiet --tags --force
  68. - uses: docker/setup-qemu-action@v2
  69. - uses: docker/setup-buildx-action@v2
  70. - uses: docker/metadata-action@v5
  71. id: meta
  72. with:
  73. images: gitea/gitea
  74. # 1.2.3-rc0
  75. tags: |
  76. type=semver,pattern={{version}}
  77. - name: Login to Docker Hub
  78. uses: docker/login-action@v2
  79. with:
  80. username: ${{ secrets.DOCKERHUB_USERNAME }}
  81. password: ${{ secrets.DOCKERHUB_TOKEN }}
  82. - name: build rootful docker image
  83. uses: docker/build-push-action@v4
  84. with:
  85. context: .
  86. platforms: linux/amd64,linux/arm64
  87. push: true
  88. tags: ${{ steps.meta.outputs.tags }}
  89. labels: ${{ steps.meta.outputs.labels }}
  90. docker-rootless:
  91. runs-on: ubuntu-latest
  92. steps:
  93. - uses: actions/checkout@v4
  94. # fetch all commits instead of only the last as some branches are long lived and could have many between versions
  95. # fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567
  96. - run: git fetch --unshallow --quiet --tags --force
  97. - uses: docker/setup-qemu-action@v2
  98. - uses: docker/setup-buildx-action@v2
  99. - uses: docker/metadata-action@v5
  100. id: meta
  101. with:
  102. images: gitea/gitea
  103. # each tag below will have the suffix of -rootless
  104. flavor: |
  105. suffix=-rootless
  106. # 1.2.3-rc0
  107. tags: |
  108. type=semver,pattern={{version}}
  109. - name: Login to Docker Hub
  110. uses: docker/login-action@v2
  111. with:
  112. username: ${{ secrets.DOCKERHUB_USERNAME }}
  113. password: ${{ secrets.DOCKERHUB_TOKEN }}
  114. - name: build rootless docker image
  115. uses: docker/build-push-action@v4
  116. with:
  117. context: .
  118. platforms: linux/amd64,linux/arm64
  119. push: true
  120. file: Dockerfile.rootless
  121. tags: ${{ steps.meta.outputs.tags }}
  122. labels: ${{ steps.meta.outputs.labels }}