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-nightly.yml 5.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. name: release-nightly
  2. on:
  3. push:
  4. branches: [main, release/v*]
  5. concurrency:
  6. group: ${{ github.workflow }}-${{ github.ref }}
  7. cancel-in-progress: true
  8. jobs:
  9. disk-clean:
  10. uses: ./.github/workflows/disk-clean.yml
  11. nightly-binary:
  12. runs-on: nscloud
  13. steps:
  14. - uses: actions/checkout@v4
  15. # fetch all commits instead of only the last as some branches are long lived and could have many between versions
  16. # fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567
  17. - run: git fetch --unshallow --quiet --tags --force
  18. - uses: actions/setup-go@v5
  19. with:
  20. go-version-file: go.mod
  21. check-latest: true
  22. - uses: actions/setup-node@v4
  23. with:
  24. node-version: 20
  25. cache: npm
  26. cache-dependency-path: package-lock.json
  27. - run: make deps-frontend deps-backend
  28. # xgo build
  29. - run: make release
  30. env:
  31. TAGS: bindata sqlite sqlite_unlock_notify
  32. - name: import gpg key
  33. id: import_gpg
  34. uses: crazy-max/ghaction-import-gpg@v6
  35. with:
  36. gpg_private_key: ${{ secrets.GPGSIGN_KEY }}
  37. passphrase: ${{ secrets.GPGSIGN_PASSPHRASE }}
  38. - name: sign binaries
  39. run: |
  40. for f in dist/release/*; do
  41. 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"
  42. done
  43. # clean branch name to get the folder name in S3
  44. - name: Get cleaned branch name
  45. id: clean_name
  46. run: |
  47. REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\///' -e 's/release\/v//')
  48. echo "Cleaned name is ${REF_NAME}"
  49. echo "branch=${REF_NAME}" >> "$GITHUB_OUTPUT"
  50. - name: configure aws
  51. uses: aws-actions/configure-aws-credentials@v4
  52. with:
  53. aws-region: ${{ secrets.AWS_REGION }}
  54. aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
  55. aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
  56. - name: upload binaries to s3
  57. run: |
  58. aws s3 sync dist/release s3://${{ secrets.AWS_S3_BUCKET }}/gitea/${{ steps.clean_name.outputs.branch }} --no-progress
  59. nightly-docker-rootful:
  60. runs-on: ubuntu-latest
  61. steps:
  62. - uses: actions/checkout@v4
  63. # fetch all commits instead of only the last as some branches are long lived and could have many between versions
  64. # fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567
  65. - run: git fetch --unshallow --quiet --tags --force
  66. - uses: actions/setup-go@v5
  67. with:
  68. go-version-file: go.mod
  69. check-latest: true
  70. - uses: docker/setup-qemu-action@v3
  71. - uses: docker/setup-buildx-action@v3
  72. - name: Get cleaned branch name
  73. id: clean_name
  74. run: |
  75. # if main then say nightly otherwise cleanup name
  76. if [ "${{ github.ref }}" = "refs/heads/main" ]; then
  77. echo "branch=nightly" >> "$GITHUB_OUTPUT"
  78. exit 0
  79. fi
  80. REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\///' -e 's/release\/v//')
  81. echo "branch=${REF_NAME}-nightly" >> "$GITHUB_OUTPUT"
  82. - name: Login to Docker Hub
  83. uses: docker/login-action@v3
  84. with:
  85. username: ${{ secrets.DOCKERHUB_USERNAME }}
  86. password: ${{ secrets.DOCKERHUB_TOKEN }}
  87. - name: fetch go modules
  88. run: make vendor
  89. - name: build rootful docker image
  90. uses: docker/build-push-action@v5
  91. with:
  92. context: .
  93. platforms: linux/amd64,linux/arm64
  94. push: true
  95. tags: gitea/gitea:${{ steps.clean_name.outputs.branch }}
  96. nightly-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: actions/setup-go@v5
  104. with:
  105. go-version-file: go.mod
  106. check-latest: true
  107. - uses: docker/setup-qemu-action@v3
  108. - uses: docker/setup-buildx-action@v3
  109. - name: Get cleaned branch name
  110. id: clean_name
  111. run: |
  112. # if main then say nightly otherwise cleanup name
  113. if [ "${{ github.ref }}" = "refs/heads/main" ]; then
  114. echo "branch=nightly" >> "$GITHUB_OUTPUT"
  115. exit 0
  116. fi
  117. REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\///' -e 's/release\/v//')
  118. echo "branch=${REF_NAME}-nightly" >> "$GITHUB_OUTPUT"
  119. - name: Login to Docker Hub
  120. uses: docker/login-action@v3
  121. with:
  122. username: ${{ secrets.DOCKERHUB_USERNAME }}
  123. password: ${{ secrets.DOCKERHUB_TOKEN }}
  124. - name: fetch go modules
  125. run: make vendor
  126. - name: build rootless docker image
  127. uses: docker/build-push-action@v5
  128. with:
  129. context: .
  130. platforms: linux/amd64,linux/arm64
  131. push: true
  132. file: Dockerfile.rootless
  133. tags: gitea/gitea:${{ steps.clean_name.outputs.branch }}-rootless