Merge PR #4: Improve GA workflow & add CI

pull/9/head
Robert Adam 2022-05-07 20:02:44 +02:00 zatwierdzone przez GitHub
commit 72da7dc7df
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
5 zmienionych plików z 98 dodań i 51 usunięć

Wyświetl plik

@ -1,50 +0,0 @@
name: Publish Docker image
on:
workflow_dispatch:
inputs:
mumble-version:
description: "The version (tag or commit hash) of Mumble to build"
required: true
default: "latest"
docker-version:
description: "Docker image version, independent of mumble version"
required: true
default: 0
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set mumble-version if manual trigger
if: "${{ github.event.inputs.mumble-version != '' }}"
run: echo "MUMBLE_VERSION=${{ github.event.inputs.mumble-version }}" >> $GITHUB_ENV
- name: Set docker-version if manual trigger
if: "${{ github.event.inputs.docker-version != '' }}"
run: echo "DOCKER_VERSION=${{ github.event.inputs.docker-version }}" >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Build
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64
push: true
build-args: |
MUMBLE_VERSION=${{ env.MUMBLE_VERSION }}
tags: mumblevoip/mumble-server:latest,mumblevoip/mumble-server:${{ env.MUMBLE_VERSION }},,mumblevoip/mumble-server:${{ env.MUMBLE_VERSION }}-${{ env.DOCKER_VERSION }}

Wyświetl plik

@ -0,0 +1,49 @@
name: Build and Publish
on:
workflow_call:
inputs:
mumble_version:
required: true
type: string
docker_version:
required: true
type: string
platforms:
required: true
type: string
publish:
required: true
type: boolean
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Build
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
if: ${{ inputs.publish }}
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
platforms: ${{ inputs.platforms }}
push: ${{ inputs.publish }}
build-args: |
MUMBLE_VERSION=${{ inputs.mumble_version }}
tags: mumblevoip/mumble-server:latest, mumblevoip/mumble-server:${{ inputs.mumble_version }}, mumblevoip/mumble-server:${{ inputs.mumble_version }}-${{ inputs.docker_version }}
env:
MUMBLE_VERSION: ${{ inputs.mumble_version }}

21
.github/workflows/ci.yml vendored 100644
Wyświetl plik

@ -0,0 +1,21 @@
name: CI
on: [ push, pull_request ]
# Note: As of now the strategy property is not supported when using reusable workflows, so we can't use a build
# matrix to create the different build cases (see https://docs.github.com/en/actions/using-workflows/reusing-workflows#limitations)
jobs:
build_1_4_230:
uses: ./.github/workflows/build_and_publish.yml
with:
mumble_version: "v1.4.230"
docker_version: '0'
publish: false
platforms: "linux/amd64"
build_latest:
uses: ./.github/workflows/build_and_publish.yml
with:
mumble_version: "latest"
docker_version: '0'
publish: false
platforms: "linux/amd64"

Wyświetl plik

@ -0,0 +1,27 @@
name: Manual dispatch
on:
workflow_dispatch:
inputs:
mumble_version:
description: "The version (tag or commit hash) of Mumble to build"
required: true
default: "latest"
docker_version:
description: "Docker image version, independent of mumble version"
required: true
default: "0"
publish:
description: "Whether the built image(s) shall be published to Dockerhub"
required: true
default: "false"
jobs:
manual_dispatch:
uses: ./.github/workflows/build_and_publish.yml
with:
mumble_version: ${{ github.event.inputs.mumble_version }}
docker_version: ${{ github.event.inputs.docker_version }}
publish: ${{ github.event.inputs.publish == 'true' }}
platforms: "linux/amd64"
secrets: inherit

Wyświetl plik

@ -43,4 +43,4 @@ cmake \
cmake --build . -j $(nproc)
ctest --output-on-failure .
ctest --output-on-failure . -j $(nproc)