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

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