2023-06-17 01:00:39 +08:00
|
|
|
name: release-nightly-assets
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ main, release/v* ]
|
|
|
|
|
2023-09-13 01:33:45 +08:00
|
|
|
concurrency:
|
2023-09-13 22:43:03 +08:00
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
2023-09-13 01:33:45 +08:00
|
|
|
cancel-in-progress: true
|
|
|
|
|
2023-06-17 01:00:39 +08:00
|
|
|
jobs:
|
2023-10-07 03:22:10 +08:00
|
|
|
disk-clean:
|
|
|
|
uses: ./.github/workflows/disk-clean.yml
|
2023-06-17 01:00:39 +08:00
|
|
|
nightly-binary:
|
2023-10-07 03:13:47 +08:00
|
|
|
runs-on: ubuntu-latest
|
2023-06-17 01:00:39 +08:00
|
|
|
steps:
|
2023-09-16 23:06:27 +08:00
|
|
|
- uses: actions/checkout@v4
|
2023-06-17 01:00:39 +08: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
|
|
|
|
- uses: actions/setup-go@v4
|
|
|
|
with:
|
2023-08-11 05:53:44 +08:00
|
|
|
go-version: "~1.21"
|
2023-06-17 01:00:39 +08:00
|
|
|
check-latest: true
|
|
|
|
- uses: actions/setup-node@v3
|
|
|
|
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
|
|
|
|
uses: crazy-max/ghaction-import-gpg@v5
|
|
|
|
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"
|
|
|
|
- name: upload binaries to s3
|
|
|
|
uses: jakejarvis/s3-sync-action@master
|
|
|
|
env:
|
|
|
|
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
|
|
|
|
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
|
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
|
|
AWS_REGION: ${{ secrets.AWS_REGION }}
|
|
|
|
SOURCE_DIR: dist/release
|
|
|
|
DEST_DIR: gitea/${{ steps.clean_name.outputs.branch }}
|
2023-09-13 01:33:45 +08:00
|
|
|
nightly-docker-rootful:
|
2023-10-07 03:13:47 +08:00
|
|
|
runs-on: ubuntu-latest
|
2023-06-17 01:00:39 +08:00
|
|
|
steps:
|
2023-09-16 23:06:27 +08:00
|
|
|
- uses: actions/checkout@v4
|
2023-06-20 02:51:35 +08: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-09-13 01:36:15 +08:00
|
|
|
- uses: actions/setup-go@v4
|
|
|
|
with:
|
|
|
|
go-version: "~1.21"
|
|
|
|
check-latest: true
|
2023-06-18 13:04:23 +08:00
|
|
|
- uses: docker/setup-qemu-action@v2
|
|
|
|
- uses: docker/setup-buildx-action@v2
|
|
|
|
- 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
|
|
|
|
uses: docker/login-action@v2
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
2023-09-13 01:33:45 +08:00
|
|
|
- name: fetch go modules
|
|
|
|
run: make vendor
|
2023-06-18 13:04:23 +08:00
|
|
|
- name: build rootful docker image
|
|
|
|
uses: docker/build-push-action@v4
|
|
|
|
with:
|
2023-06-20 13:37:32 +08:00
|
|
|
context: .
|
2023-06-18 13:04:23 +08:00
|
|
|
platforms: linux/amd64,linux/arm64
|
|
|
|
push: true
|
|
|
|
tags: gitea/gitea:${{ steps.clean_name.outputs.branch }}
|
2023-09-13 01:33:45 +08:00
|
|
|
nightly-docker-rootless:
|
2023-10-07 03:13:47 +08:00
|
|
|
runs-on: ubuntu-latest
|
2023-09-13 01:33:45 +08:00
|
|
|
steps:
|
2023-09-16 23:06:27 +08:00
|
|
|
- uses: actions/checkout@v4
|
2023-09-13 01:33:45 +08: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-09-13 01:36:15 +08:00
|
|
|
- uses: actions/setup-go@v4
|
|
|
|
with:
|
|
|
|
go-version: "~1.21"
|
|
|
|
check-latest: true
|
2023-09-13 01:33:45 +08:00
|
|
|
- uses: docker/setup-qemu-action@v2
|
|
|
|
- uses: docker/setup-buildx-action@v2
|
|
|
|
- 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
|
|
|
|
uses: docker/login-action@v2
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
- name: fetch go modules
|
|
|
|
run: make vendor
|
2023-06-18 13:04:23 +08:00
|
|
|
- name: build rootless docker image
|
|
|
|
uses: docker/build-push-action@v4
|
|
|
|
with:
|
2023-06-20 13:37:32 +08:00
|
|
|
context: .
|
2023-06-18 13:04:23 +08:00
|
|
|
platforms: linux/amd64,linux/arm64
|
|
|
|
push: true
|
|
|
|
file: Dockerfile.rootless
|
|
|
|
tags: gitea/gitea:${{ steps.clean_name.outputs.branch }}-rootless
|