2023-10-11 12:09:32 +05:30
|
|
|
name: release-tag-rc
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
2023-10-30 13:26:43 +05:30
|
|
|
- "v1*-rc*"
|
2023-10-11 12:09:32 +05:30
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: false
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
binary:
|
|
|
|
runs-on: nscloud
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
# fetch all commits instead of only the last as some branches are long lived and could have many between versions
|
|
|
|
# fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567
|
|
|
|
- run: git fetch --unshallow --quiet --tags --force
|
|
|
|
- uses: actions/setup-go@v4
|
|
|
|
with:
|
2023-10-17 15:54:54 +05:30
|
|
|
go-version-file: go.mod
|
2023-10-11 12:09:32 +05:30
|
|
|
check-latest: true
|
2023-10-30 13:26:43 +05:30
|
|
|
- uses: actions/setup-node@v4
|
2023-10-11 12:09:32 +05:30
|
|
|
with:
|
|
|
|
node-version: 20
|
|
|
|
- run: make deps-frontend deps-backend
|
|
|
|
# xgo build
|
|
|
|
- run: make release
|
|
|
|
env:
|
|
|
|
TAGS: bindata sqlite sqlite_unlock_notify
|
|
|
|
- name: import gpg key
|
|
|
|
id: import_gpg
|
2023-10-30 13:26:43 +05:30
|
|
|
uses: crazy-max/ghaction-import-gpg@v6
|
2023-10-11 12:09:32 +05:30
|
|
|
with:
|
|
|
|
gpg_private_key: ${{ secrets.GPGSIGN_KEY }}
|
|
|
|
passphrase: ${{ secrets.GPGSIGN_PASSPHRASE }}
|
|
|
|
- name: sign binaries
|
|
|
|
run: |
|
|
|
|
for f in dist/release/*; do
|
|
|
|
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"
|
|
|
|
done
|
|
|
|
# clean branch name to get the folder name in S3
|
|
|
|
- name: Get cleaned branch name
|
|
|
|
id: clean_name
|
|
|
|
run: |
|
2023-11-29 02:48:01 +05:30
|
|
|
REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\/v//' -e 's/release\/v//')
|
2023-10-11 12:09:32 +05:30
|
|
|
echo "Cleaned name is ${REF_NAME}"
|
|
|
|
echo "branch=${REF_NAME}" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: configure aws
|
|
|
|
uses: aws-actions/configure-aws-credentials@v4
|
|
|
|
with:
|
|
|
|
aws-region: ${{ secrets.AWS_REGION }}
|
|
|
|
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
|
|
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
|
|
- name: upload binaries to s3
|
|
|
|
run: |
|
|
|
|
aws s3 sync dist/release s3://${{ secrets.AWS_S3_BUCKET }}/gitea/${{ steps.clean_name.outputs.branch }} --no-progress
|
2023-11-26 00:15:31 +05:30
|
|
|
- name: Install GH CLI
|
|
|
|
uses: dev-hanz-ops/install-gh-cli-action@v0.1.0
|
|
|
|
with:
|
|
|
|
gh-cli-version: 2.39.1
|
2023-10-11 12:09:32 +05:30
|
|
|
- name: create github release
|
|
|
|
run: |
|
|
|
|
gh release create ${{ github.ref_name }} --title ${{ github.ref_name }} --draft --notes-from-tag dist/release/*
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
|
|
|
docker-rootful:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
# fetch all commits instead of only the last as some branches are long lived and could have many between versions
|
|
|
|
# fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567
|
|
|
|
- run: git fetch --unshallow --quiet --tags --force
|
2023-10-30 13:26:43 +05:30
|
|
|
- uses: docker/setup-qemu-action@v3
|
|
|
|
- uses: docker/setup-buildx-action@v3
|
2023-10-11 12:09:32 +05:30
|
|
|
- uses: docker/metadata-action@v5
|
|
|
|
id: meta
|
|
|
|
with:
|
|
|
|
images: gitea/gitea
|
|
|
|
# 1.2.3-rc0
|
|
|
|
tags: |
|
|
|
|
type=semver,pattern={{version}}
|
|
|
|
- name: Login to Docker Hub
|
2023-10-30 13:26:43 +05:30
|
|
|
uses: docker/login-action@v3
|
2023-10-11 12:09:32 +05:30
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
- name: build rootful docker image
|
2023-10-30 13:26:43 +05:30
|
|
|
uses: docker/build-push-action@v5
|
2023-10-11 12:09:32 +05:30
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
platforms: linux/amd64,linux/arm64
|
|
|
|
push: true
|
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
|
|
docker-rootless:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
# fetch all commits instead of only the last as some branches are long lived and could have many between versions
|
|
|
|
# fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567
|
|
|
|
- run: git fetch --unshallow --quiet --tags --force
|
2023-10-30 13:26:43 +05:30
|
|
|
- uses: docker/setup-qemu-action@v3
|
|
|
|
- uses: docker/setup-buildx-action@v3
|
2023-10-11 12:09:32 +05:30
|
|
|
- uses: docker/metadata-action@v5
|
|
|
|
id: meta
|
|
|
|
with:
|
|
|
|
images: gitea/gitea
|
|
|
|
# each tag below will have the suffix of -rootless
|
|
|
|
flavor: |
|
|
|
|
suffix=-rootless
|
|
|
|
# 1.2.3-rc0
|
|
|
|
tags: |
|
|
|
|
type=semver,pattern={{version}}
|
|
|
|
- name: Login to Docker Hub
|
2023-10-30 13:26:43 +05:30
|
|
|
uses: docker/login-action@v3
|
2023-10-11 12:09:32 +05:30
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
- name: build rootless docker image
|
2023-10-30 13:26:43 +05:30
|
|
|
uses: docker/build-push-action@v5
|
2023-10-11 12:09:32 +05:30
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
platforms: linux/amd64,linux/arm64
|
|
|
|
push: true
|
|
|
|
file: Dockerfile.rootless
|
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|