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