2023-10-11 02:39:32 -04:00
|
|
|
name: release-nightly
|
2023-06-16 13:00:39 -04:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2023-10-30 03:56:43 -04:00
|
|
|
branches: [main, release/v*]
|
2023-06-16 13:00:39 -04:00
|
|
|
|
2023-09-12 13:33:45 -04:00
|
|
|
concurrency:
|
2023-09-13 10:43:03 -04:00
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
2023-09-12 13:33:45 -04:00
|
|
|
cancel-in-progress: true
|
|
|
|
|
2023-06-16 13:00:39 -04:00
|
|
|
jobs:
|
2023-10-06 15:22:10 -04:00
|
|
|
disk-clean:
|
|
|
|
uses: ./.github/workflows/disk-clean.yml
|
2023-06-16 13:00:39 -04:00
|
|
|
nightly-binary:
|
2023-10-07 00:14:45 -04:00
|
|
|
runs-on: nscloud
|
2023-06-16 13:00:39 -04:00
|
|
|
steps:
|
2023-09-16 11:06:27 -04:00
|
|
|
- uses: actions/checkout@v4
|
2023-06-16 13:00:39 -04:00
|
|
|
# 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-12-21 00:31:04 -05:00
|
|
|
- uses: actions/setup-go@v5
|
2023-06-16 13:00:39 -04:00
|
|
|
with:
|
2023-10-17 06:24:54 -04:00
|
|
|
go-version-file: go.mod
|
2023-06-16 13:00:39 -04:00
|
|
|
check-latest: true
|
2023-10-30 03:56:43 -04:00
|
|
|
- uses: actions/setup-node@v4
|
2023-06-16 13:00:39 -04:00
|
|
|
with:
|
|
|
|
node-version: 20
|
2024-04-19 03:16:42 -04:00
|
|
|
cache: npm
|
|
|
|
cache-dependency-path: package-lock.json
|
2023-06-16 13:00:39 -04:00
|
|
|
- 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 03:56:43 -04:00
|
|
|
uses: crazy-max/ghaction-import-gpg@v6
|
2023-06-16 13:00:39 -04:00
|
|
|
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: |
|
|
|
|
REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\///' -e 's/release\/v//')
|
|
|
|
echo "Cleaned name is ${REF_NAME}"
|
|
|
|
echo "branch=${REF_NAME}" >> "$GITHUB_OUTPUT"
|
2023-10-09 06:12:19 -04:00
|
|
|
- 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 }}
|
2023-06-16 13:00:39 -04:00
|
|
|
- name: upload binaries to s3
|
2023-10-09 06:12:19 -04:00
|
|
|
run: |
|
|
|
|
aws s3 sync dist/release s3://${{ secrets.AWS_S3_BUCKET }}/gitea/${{ steps.clean_name.outputs.branch }} --no-progress
|
2023-09-12 13:33:45 -04:00
|
|
|
nightly-docker-rootful:
|
2023-10-06 15:13:47 -04:00
|
|
|
runs-on: ubuntu-latest
|
2023-06-16 13:00:39 -04:00
|
|
|
steps:
|
2023-09-16 11:06:27 -04:00
|
|
|
- uses: actions/checkout@v4
|
2023-06-19 14:51:35 -04:00
|
|
|
# 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-12-21 00:31:04 -05:00
|
|
|
- uses: actions/setup-go@v5
|
2023-09-12 13:36:15 -04:00
|
|
|
with:
|
2023-10-17 06:24:54 -04:00
|
|
|
go-version-file: go.mod
|
2023-09-12 13:36:15 -04:00
|
|
|
check-latest: true
|
2023-10-30 03:56:43 -04:00
|
|
|
- uses: docker/setup-qemu-action@v3
|
|
|
|
- uses: docker/setup-buildx-action@v3
|
2023-06-18 01:04:23 -04:00
|
|
|
- name: Get cleaned branch name
|
|
|
|
id: clean_name
|
|
|
|
run: |
|
|
|
|
# if main then say nightly otherwise cleanup name
|
|
|
|
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
|
|
|
|
echo "branch=nightly" >> "$GITHUB_OUTPUT"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\///' -e 's/release\/v//')
|
|
|
|
echo "branch=${REF_NAME}-nightly" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Login to Docker Hub
|
2023-10-30 03:56:43 -04:00
|
|
|
uses: docker/login-action@v3
|
2023-06-18 01:04:23 -04:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
2023-09-12 13:33:45 -04:00
|
|
|
- name: fetch go modules
|
|
|
|
run: make vendor
|
2023-06-18 01:04:23 -04:00
|
|
|
- name: build rootful docker image
|
2023-10-30 03:56:43 -04:00
|
|
|
uses: docker/build-push-action@v5
|
2023-06-18 01:04:23 -04:00
|
|
|
with:
|
2023-06-20 01:37:32 -04:00
|
|
|
context: .
|
2023-06-18 01:04:23 -04:00
|
|
|
platforms: linux/amd64,linux/arm64
|
|
|
|
push: true
|
|
|
|
tags: gitea/gitea:${{ steps.clean_name.outputs.branch }}
|
2023-09-12 13:33:45 -04:00
|
|
|
nightly-docker-rootless:
|
2023-10-06 15:13:47 -04:00
|
|
|
runs-on: ubuntu-latest
|
2023-09-12 13:33:45 -04:00
|
|
|
steps:
|
2023-09-16 11:06:27 -04:00
|
|
|
- uses: actions/checkout@v4
|
2023-09-12 13:33:45 -04:00
|
|
|
# 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-12-21 00:31:04 -05:00
|
|
|
- uses: actions/setup-go@v5
|
2023-09-12 13:36:15 -04:00
|
|
|
with:
|
2023-10-17 06:24:54 -04:00
|
|
|
go-version-file: go.mod
|
2023-09-12 13:36:15 -04:00
|
|
|
check-latest: true
|
2023-10-30 03:56:43 -04:00
|
|
|
- uses: docker/setup-qemu-action@v3
|
|
|
|
- uses: docker/setup-buildx-action@v3
|
2023-09-12 13:33:45 -04:00
|
|
|
- name: Get cleaned branch name
|
|
|
|
id: clean_name
|
|
|
|
run: |
|
|
|
|
# if main then say nightly otherwise cleanup name
|
|
|
|
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
|
|
|
|
echo "branch=nightly" >> "$GITHUB_OUTPUT"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\///' -e 's/release\/v//')
|
|
|
|
echo "branch=${REF_NAME}-nightly" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Login to Docker Hub
|
2023-10-30 03:56:43 -04:00
|
|
|
uses: docker/login-action@v3
|
2023-09-12 13:33:45 -04:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
- name: fetch go modules
|
|
|
|
run: make vendor
|
2023-06-18 01:04:23 -04:00
|
|
|
- name: build rootless docker image
|
2023-10-30 03:56:43 -04:00
|
|
|
uses: docker/build-push-action@v5
|
2023-06-18 01:04:23 -04:00
|
|
|
with:
|
2023-06-20 01:37:32 -04:00
|
|
|
context: .
|
2023-06-18 01:04:23 -04:00
|
|
|
platforms: linux/amd64,linux/arm64
|
|
|
|
push: true
|
|
|
|
file: Dockerfile.rootless
|
|
|
|
tags: gitea/gitea:${{ steps.clean_name.outputs.branch }}-rootless
|