code.gitea.io/gitea@v1.21.7/.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@v4
    21          with:
    22            go-version: "~1.21"
    23            check-latest: true
    24        - uses: actions/setup-node@v3
    25          with:
    26            node-version: 20
    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@v5
    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\/v//' -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        - name: Install GH CLI
    60          uses: dev-hanz-ops/install-gh-cli-action@v0.1.0
    61          with:
    62            gh-cli-version: 2.39.1
    63        - name: create github release
    64          run: |
    65            gh release create ${{ github.ref_name }} --title ${{ github.ref_name }} --draft --notes-from-tag dist/release/*
    66          env:
    67            GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
    68    docker-rootful:
    69      runs-on: ubuntu-latest
    70      steps:
    71        - uses: actions/checkout@v4
    72        # fetch all commits instead of only the last as some branches are long lived and could have many between versions
    73        # fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567
    74        - run: git fetch --unshallow --quiet --tags --force
    75        - uses: docker/setup-qemu-action@v2
    76        - uses: docker/setup-buildx-action@v2
    77        - uses: docker/metadata-action@v5
    78          id: meta
    79          with:
    80            images: gitea/gitea
    81            flavor: |
    82              latest=false
    83            # 1.2.3-rc0
    84            tags: |
    85              type=semver,pattern={{version}}
    86        - name: Login to Docker Hub
    87          uses: docker/login-action@v2
    88          with:
    89            username: ${{ secrets.DOCKERHUB_USERNAME }}
    90            password: ${{ secrets.DOCKERHUB_TOKEN }}
    91        - name: build rootful docker image
    92          uses: docker/build-push-action@v4
    93          with:
    94            context: .
    95            platforms: linux/amd64,linux/arm64
    96            push: true
    97            tags: ${{ steps.meta.outputs.tags }}
    98            labels: ${{ steps.meta.outputs.labels }}
    99    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: docker/setup-qemu-action@v2
   107        - uses: docker/setup-buildx-action@v2
   108        - uses: docker/metadata-action@v5
   109          id: meta
   110          with:
   111            images: gitea/gitea
   112            # each tag below will have the suffix of -rootless
   113            flavor: |
   114              latest=false
   115              suffix=-rootless
   116            # 1.2.3-rc0
   117            tags: |
   118              type=semver,pattern={{version}}
   119        - name: Login to Docker Hub
   120          uses: docker/login-action@v2
   121          with:
   122            username: ${{ secrets.DOCKERHUB_USERNAME }}
   123            password: ${{ secrets.DOCKERHUB_TOKEN }}
   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: ${{ steps.meta.outputs.tags }}
   132            labels: ${{ steps.meta.outputs.labels }}