code.gitea.io/gitea@v1.22.3/.github/workflows/release-tag-rc.yml (about)

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