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.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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@v5
  18. with:
  19. go-version-file: go.mod
  20. check-latest: true
  21. - uses: actions/setup-node@v4
  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@v6
  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\/v//' -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: Install GH CLI
  57. uses: dev-hanz-ops/install-gh-cli-action@v0.1.0
  58. with:
  59. gh-cli-version: 2.39.1
  60. - name: create github release
  61. run: |
  62. gh release create ${{ github.ref_name }} --title ${{ github.ref_name }} --draft --notes-from-tag dist/release/*
  63. env:
  64. GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
  65. docker-rootful:
  66. runs-on: ubuntu-latest
  67. steps:
  68. - uses: actions/checkout@v4
  69. # fetch all commits instead of only the last as some branches are long lived and could have many between versions
  70. # fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567
  71. - run: git fetch --unshallow --quiet --tags --force
  72. - uses: docker/setup-qemu-action@v3
  73. - uses: docker/setup-buildx-action@v3
  74. - uses: docker/metadata-action@v5
  75. id: meta
  76. with:
  77. images: gitea/gitea
  78. flavor: |
  79. latest=false
  80. # 1.2.3-rc0
  81. tags: |
  82. type=semver,pattern={{version}}
  83. - name: Login to Docker Hub
  84. uses: docker/login-action@v3
  85. with:
  86. username: ${{ secrets.DOCKERHUB_USERNAME }}
  87. password: ${{ secrets.DOCKERHUB_TOKEN }}
  88. - name: build rootful docker image
  89. uses: docker/build-push-action@v5
  90. with:
  91. context: .
  92. platforms: linux/amd64,linux/arm64
  93. push: true
  94. tags: ${{ steps.meta.outputs.tags }}
  95. labels: ${{ steps.meta.outputs.labels }}
  96. docker-rootless:
  97. runs-on: ubuntu-latest
  98. steps:
  99. - uses: actions/checkout@v4
  100. # fetch all commits instead of only the last as some branches are long lived and could have many between versions
  101. # fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567
  102. - run: git fetch --unshallow --quiet --tags --force
  103. - uses: docker/setup-qemu-action@v3
  104. - uses: docker/setup-buildx-action@v3
  105. - uses: docker/metadata-action@v5
  106. id: meta
  107. with:
  108. images: gitea/gitea
  109. # each tag below will have the suffix of -rootless
  110. flavor: |
  111. latest=false
  112. suffix=-rootless
  113. # 1.2.3-rc0
  114. tags: |
  115. type=semver,pattern={{version}}
  116. - name: Login to Docker Hub
  117. uses: docker/login-action@v3
  118. with:
  119. username: ${{ secrets.DOCKERHUB_USERNAME }}
  120. password: ${{ secrets.DOCKERHUB_TOKEN }}
  121. - name: build rootless docker image
  122. uses: docker/build-push-action@v5
  123. with:
  124. context: .
  125. platforms: linux/amd64,linux/arm64
  126. push: true
  127. file: Dockerfile.rootless
  128. tags: ${{ steps.meta.outputs.tags }}
  129. labels: ${{ steps.meta.outputs.labels }}