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

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