Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 78 additions & 33 deletions .github/workflows/build_pre_release.yaml
Original file line number Diff line number Diff line change
@@ -1,95 +1,140 @@
on:
workflow_dispatch:
inputs:
VERSION:
description: 'Version to build'
required: false
type: string
TAG:
description: 'Tag name to use'
required: false
type: string

env:
VERSION: ${{ inputs.VERSION }}
REGISTRY: ${{ vars.DOCKERHUB_REGISTRY }}
TAG: ${{ inputs.TAG }}

jobs:

draft:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Run github-create-draft
run: make github-create-draft
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create draft release
uses: ncipollo/release-action@v1
with:
tag: ${{ env.TAG }}
name: ${{ env.TAG }}
bodyFile: RELEASE.md
draft: true
generateReleaseNotes: true
removeArtifacts: true

docker-build:
needs: [draft]
runs-on: ${{ matrix.runs_on }}
strategy:
fail-fast: false
matrix:
include:
- runs_on: ubuntu-24.04-arm
docker_arch: arm64v8
arch: arm64
- runs_on: ubuntu-24.04
docker_arch: amd64
arch: arm64
env:
ARCH: ${{ matrix.arch }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

# Compile and release
- name: Compile and release for ${{matrix.arch}}
run:
./release.bash "${{ env.REGISTRY }}:${{ env.TAG }}" build-tgz build-image

# Push to DockerHub
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Run dockerhub for ${{matrix.docker_arch}}
run: make ${{matrix.docker_arch}}-dockerhub
- name: Run deb for ${{matrix.docker_arch}}
run: make ${{matrix.docker_arch}}-deb
- name: Upload deb files
run: make github-upload-all
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run docker push for ${{matrix.arch}}
run:
./release.bash "${{ env.REGISTRY }}:${{ env.TAG }}" push-image

# Upload files to draft release
- name: Upload files to draft release
uses: ncipollo/release-action@v1
with:
tag: ${{ env.TAG }}
artifacts: release/*.tgz
allowUpdates: true
updateOnlyUnreleased: true
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
omitDraftDuringUpdate: true

client-build:
needs: [draft]
runs-on: ${{ matrix.runs_on }}
strategy:
fail-fast: false
matrix:
include:
- runs_on: ubuntu-24.04-arm
docker_arch: arm64v8
arch: arm64
- runs_on: ubuntu-24.04
docker_arch: amd64
arch: amd64
- runs_on: ubuntu-24.04-arm
arch: arm32
continue-on-error: true
env:
ARCH: ${{ matrix.arch }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Run client for ${{matrix.docker_arch}}
run: make ${{matrix.docker_arch}}-client
- name: Upload artifacts
run: make github-upload-all
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Compile the client
- name: Run client for ${{matrix.arch}}
run: ./release.bash "${{ env.REGISTRY }}:${{ env.TAG }}" client-tgz

# Upload files to draft release
- name: Upload files to draft release
uses: ncipollo/release-action@v1
with:
tag: ${{ env.TAG }}
artifacts: release/*.tgz
allowUpdates: true
updateOnlyUnreleased: true
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
omitDraftDuringUpdate: true

prerelease:
runs-on: ubuntu-latest
needs: [client-build, docker-build]
steps:
- name: Checkout
uses: actions/checkout@v3

# Update docker manifest
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Run dockerhub-manifest
run: make dockerhub-manifest
- name: Run github-create-pre-release
run: make github-create-pre-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create manifest
run:
./release.bash "${{ env.REGISTRY }}:${{ env.TAG }}" manifest

# Create pre-release
- name: Make release as pre-release
uses: ncipollo/release-action@v1
with:
tag: ${{ env.TAG }}
prerelease: true
allowUpdates: true
updateOnlyUnreleased: true
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
99 changes: 81 additions & 18 deletions .github/workflows/build_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@ on:
- .github/workflows/*.yaml
pull_request:
workflow_dispatch:
inputs:
VERSION:
description: 'Version to build'
required: false
type: string

env:
VERSION: ${{ inputs.VERSION }}

jobs:
docker-build:
Expand All @@ -24,9 +16,11 @@ jobs:
matrix:
include:
- runs_on: ubuntu-24.04-arm
docker_arch: arm64v8
arch: arm64
- runs_on: ubuntu-24.04
docker_arch: amd64
arch: amd64
env:
ARCH: ${{ matrix.arch }}
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -41,8 +35,16 @@ jobs:
else
echo "TAG=ref-${{ github.ref_name }}" >> $GITHUB_ENV;
fi
- name: Run docker-build for ${{matrix.docker_arch}}
run: make ${{matrix.docker_arch}}-docker-build
- name: Run docker for ${{matrix.arch}}
env:
TAG: ${{ env.TAG }}
run: ./release.bash "${{ env.REGISTRY }}:${{ env.TAG }}" build-image build-deb

# Push Artifacts to GitHub
- uses: actions/upload-artifact@v4
with:
name: server-${{ matrix.arch }}
path: release/

# Push to DockerHub
- name: Login to Docker Hub
Expand All @@ -51,9 +53,9 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_TEST_USERNAME }}
password: ${{ secrets.DOCKERHUB_TEST_TOKEN }}
- name: Run dockerhub for ${{matrix.docker_arch}}
- name: Run dockerhub for ${{matrix.arch}}
if: vars.DOCKERHUB_TEST_REGISTRY
run: make ${{matrix.docker_arch}}-dockerhub
run: ./release.bash "${{ env.REGISTRY }}:${{ env.TAG }}" push-image

client-build:
runs-on: ${{ matrix.runs_on }}
Expand All @@ -62,13 +64,74 @@ jobs:
matrix:
include:
- runs_on: ubuntu-24.04-arm
docker_arch: arm64v8
arch: arm64
- runs_on: ubuntu-24.04
docker_arch: amd64
arch: amd64
- runs_on: ubuntu-24.04-arm
arch: arm32
continue-on-error: true
env:
ARCH: ${{ matrix.arch }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Run client for ${{matrix.docker_arch}}
run: make ${{matrix.docker_arch}}-client
- name: Set repository name
if: vars.DOCKERHUB_TEST_REGISTRY
run:
echo "REGISTRY=${{ vars.DOCKERHUB_TEST_REGISTRY }}" >> $GITHUB_ENV;
if [[ -n "${{ github.event.pull_request.number }}" ]]; then
echo "TAG=github-pr-${{ github.event.pull_request.number }}" >> $GITHUB_ENV;
else
echo "TAG=ref-${{ github.ref_name }}" >> $GITHUB_ENV;
fi
# Compile the client
- name: Run client for ${{matrix.arch}}
run: ./release.bash "${{ env.REGISTRY }}:${{ env.TAG }}" client-tgz
# Push Artifacts to GitHub
- uses: actions/upload-artifact@v4
with:
name: client-${{ matrix.arch }}
path: release/

manifest:
runs-on: ubuntu-latest
needs: [client-build, docker-build]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set repository name
if: vars.DOCKERHUB_TEST_REGISTRY
run:
echo "REGISTRY=${{ vars.DOCKERHUB_TEST_REGISTRY }}" >> $GITHUB_ENV;
if [[ -n "${{ github.event.pull_request.number }}" ]]; then
echo "TAG=github-pr-${{ github.event.pull_request.number }}" >> $GITHUB_ENV;
else
echo "TAG=ref-${{ github.ref_name }}" >> $GITHUB_ENV;
fi
- name: Login to Docker Hub
if: vars.DOCKERHUB_TEST_REGISTRY
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_TEST_USERNAME }}
password: ${{ secrets.DOCKERHUB_TEST_TOKEN }}
- name: Run dockerhub-manifest
run: ./release.bash "${{ env.REGISTRY }}:${{ env.TAG }}" manifest
- name: Comment image name on PR
if: github.event_name == 'pull_request'
env:
REGISTRY: ${{ env.REGISTRY }}
TAG: ${{ env.TAG }}
uses: actions/github-script@v7
with:
script: |
const imageName = `${{ env.REGISTRY }}:${{ env.TAG }}`;
const body = `✅ Docker image pushed: \`${imageName}\``;

await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: body
});
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
type: string

env:
REGISTRY: ${{ vars.DOCKERHUB_REGISTRY }}
TAG: ${{ inputs.TAG }}

jobs:
Expand All @@ -20,7 +21,17 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Run dockerhub-latest-release
run: make github-latest-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Update the dockerhub tags
- name: Create semver manifest
run: ./release.bash "${{ env.REGISTRY }}:${{ env.TAG }}" manifest-latest

# Create release
- name: Make it latest
uses: ncipollo/release-action@v1
with:
tag: ${{ env.TAG }}
allowUpdates: true
updateOnlyUnreleased: true
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
Loading