feat(ci): arm builds, push multiple registries
Release-As: 0.13.0
This commit is contained in:
32
.github/workflows/go.yml
vendored
32
.github/workflows/go.yml
vendored
@@ -1,32 +0,0 @@
|
|||||||
name: go
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
- develop
|
|
||||||
pull_request:
|
|
||||||
jobs:
|
|
||||||
test:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Setup Go
|
|
||||||
uses: actions/setup-go@v1
|
|
||||||
with:
|
|
||||||
go-version: 1.16.x
|
|
||||||
- name: Checkout code into the Go module directory
|
|
||||||
uses: actions/checkout@v1
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
sudo apt update
|
|
||||||
sudo apt install build-essential git sqlite libtag1-dev ffmpeg libasound-dev
|
|
||||||
- name: Lint
|
|
||||||
uses: golangci/golangci-lint-action@v2
|
|
||||||
with:
|
|
||||||
version: v1.33
|
|
||||||
- name: Update version.go
|
|
||||||
run: |
|
|
||||||
_version=v$(cat version.txt)
|
|
||||||
sed -Ei "s/VERSION = \"v0.0.0\"/VERSION = \"${_version}-nightly\"/g" version/version.go
|
|
||||||
./_do_gen_handler_tests
|
|
||||||
- name: Test
|
|
||||||
run: go test ./...
|
|
||||||
44
.github/workflows/image.yml
vendored
44
.github/workflows/image.yml
vendored
@@ -1,44 +0,0 @@
|
|||||||
name: image
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- v*
|
|
||||||
workflow_dispatch:
|
|
||||||
env:
|
|
||||||
REGISTRY_IMAGE: sentriz/gonic
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: "!contains(github.event.head_commit.message, '[ci-skip]')"
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v1
|
|
||||||
with:
|
|
||||||
image: tonistiigi/binfmt:latest
|
|
||||||
platforms: all
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
id: buildx
|
|
||||||
uses: docker/setup-buildx-action@v1
|
|
||||||
with:
|
|
||||||
install: true
|
|
||||||
version: latest
|
|
||||||
driver-opts: image=moby/buildkit:master
|
|
||||||
- name: Login to DockerHub
|
|
||||||
uses: docker/login-action@v1
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
||||||
- name: Set release version
|
|
||||||
run: echo "RELEASE_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
|
|
||||||
- name: Build and Push
|
|
||||||
uses: docker/build-push-action@v2
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
file: ./Dockerfile
|
|
||||||
platforms: linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7
|
|
||||||
push: true
|
|
||||||
tags: |
|
|
||||||
${{ env.REGISTRY_IMAGE }}:latest
|
|
||||||
${{ env.REGISTRY_IMAGE }}:${{ env.RELEASE_VERSION }}
|
|
||||||
63
.github/workflows/nightly-release.yaml
vendored
63
.github/workflows/nightly-release.yaml
vendored
@@ -4,24 +4,59 @@ on:
|
|||||||
- cron: '0 0 * * *'
|
- cron: '0 0 * * *'
|
||||||
workflow_dispatch: {}
|
workflow_dispatch: {}
|
||||||
jobs:
|
jobs:
|
||||||
|
test:
|
||||||
|
name: Lint and test
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Setup Go
|
||||||
|
uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: 1.16.x
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt update -qq
|
||||||
|
sudo apt install -y -qq build-essential git sqlite libtag1-dev ffmpeg libasound-dev
|
||||||
|
- name: Lint
|
||||||
|
uses: golangci/golangci-lint-action@v2
|
||||||
|
with:
|
||||||
|
version: latest
|
||||||
|
skip-go-installation: true
|
||||||
|
- name: Test
|
||||||
|
run: go test ./...
|
||||||
build-release:
|
build-release:
|
||||||
name: Build and release Docker image
|
name: Build and release Docker image
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
needs: [test]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
- name: Update version.go
|
- name: Set up QEMU
|
||||||
run: |
|
uses: docker/setup-qemu-action@v1
|
||||||
_version=v$(cat version.txt)
|
with:
|
||||||
sed -Ei "s/VERSION = \"v0.0.0\"/VERSION = \"${_version}-nightly\"/g" version/version.go
|
image: tonistiigi/binfmt:latest
|
||||||
|
platforms: all
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
id: buildx
|
||||||
|
uses: docker/setup-buildx-action@v1
|
||||||
|
with:
|
||||||
|
install: true
|
||||||
|
version: latest
|
||||||
|
driver-opts: image=moby/buildkit:master
|
||||||
|
- name: Login into DockerHub
|
||||||
|
run: echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
|
||||||
- name: Login into GitHub Container Registry
|
- name: Login into GitHub Container Registry
|
||||||
run: echo ${{ secrets.CR_PAT }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
|
run: echo ${{ secrets.CR_PAT }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
|
||||||
- name: Build Docker image
|
- name: Build and Push
|
||||||
run: |
|
uses: docker/build-push-action@v2
|
||||||
docker build \
|
with:
|
||||||
-t "ghcr.io/${GITHUB_REPOSITORY}:${GITHUB_SHA:0:7}" \
|
context: .
|
||||||
-t "ghcr.io/${GITHUB_REPOSITORY}:nightly" .
|
file: ./Dockerfile
|
||||||
- name: Release Docker image
|
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
||||||
run: |
|
push: true
|
||||||
docker push "ghcr.io/${GITHUB_REPOSITORY}:${GITHUB_SHA:0:7}"
|
tags: |
|
||||||
docker push "ghcr.io/${GITHUB_REPOSITORY}:nightly"
|
ghcr.io/${{ github.repository }}:${{ github.sha }}
|
||||||
|
ghcr.io/${{ github.repository }}:nightly
|
||||||
|
${{ github.repository }}:${{ github.sha }}
|
||||||
|
${{ github.repository }}:nightly
|
||||||
|
|||||||
52
.github/workflows/release.yaml
vendored
52
.github/workflows/release.yaml
vendored
@@ -5,7 +5,7 @@ on:
|
|||||||
- master
|
- master
|
||||||
jobs:
|
jobs:
|
||||||
release-please:
|
release-please:
|
||||||
name: Run release-please
|
name: Run Release Please
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
release_created: ${{ steps.release.outputs.release_created }}
|
release_created: ${{ steps.release.outputs.release_created }}
|
||||||
@@ -13,33 +13,47 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
- name: Setup release please
|
- name: Setup Release Please
|
||||||
uses: google-github-actions/release-please-action@v2
|
uses: google-github-actions/release-please-action@v2
|
||||||
id: release
|
id: release
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.CR_PAT }}
|
||||||
release-type: simple
|
release-type: simple
|
||||||
changelog-path: CHANGELOG.md
|
changelog-path: CHANGELOG.md
|
||||||
package-name: gonic
|
package-name: gonic
|
||||||
build-tag-publish:
|
build-release:
|
||||||
name: Build, tag, and publish Docker image
|
name: Build, tag, and publish Docker image
|
||||||
if: ${{ needs.release-please.outputs.release_created }}
|
|
||||||
needs: release-please
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
needs: [release-please]
|
||||||
|
if: ${{ needs.release-please.outputs.release_created }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
- name: Update version.go
|
- name: Set up QEMU
|
||||||
run: sed -Ei 's/VERSION = "v0.0.0"/VERSION = "${{ needs.release-please.outputs.tag_name }}"/g' version/version.go
|
uses: docker/setup-qemu-action@v1
|
||||||
|
with:
|
||||||
|
image: tonistiigi/binfmt:latest
|
||||||
|
platforms: all
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
id: buildx
|
||||||
|
uses: docker/setup-buildx-action@v1
|
||||||
|
with:
|
||||||
|
install: true
|
||||||
|
version: latest
|
||||||
|
driver-opts: image=moby/buildkit:master
|
||||||
|
- name: Login into DockerHub
|
||||||
|
run: echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
|
||||||
- name: Login into GitHub Container Registry
|
- name: Login into GitHub Container Registry
|
||||||
run: echo ${{ secrets.CR_PAT }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
|
run: echo ${{ secrets.CR_PAT }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
|
||||||
- name: Build Docker image
|
- name: Build and Push
|
||||||
if: ${{ needs.release-please.outputs.release_created }}
|
uses: docker/build-push-action@v2
|
||||||
run: |
|
with:
|
||||||
docker build \
|
context: .
|
||||||
-t "ghcr.io/${GITHUB_REPOSITORY}:${{ needs.release-please.outputs.tag_name }}" \
|
file: ./Dockerfile
|
||||||
-t "ghcr.io/${GITHUB_REPOSITORY}:latest" .
|
platforms: linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7
|
||||||
- name: Release Docker image
|
push: true
|
||||||
run: |
|
tags: |
|
||||||
docker push "ghcr.io/${GITHUB_REPOSITORY}:${{ needs.release-please.outputs.tag_name }}"
|
ghcr.io/${{ github.repository }}:${{ needs.release-please.outputs.tag_name }}
|
||||||
docker push "ghcr.io/${GITHUB_REPOSITORY}:latest"
|
ghcr.io/${{ github.repository }}:latest
|
||||||
|
${{ github.repository }}:${{ needs.release-please.outputs.tag_name }}
|
||||||
|
${{ github.repository }}:latest
|
||||||
|
|||||||
29
.github/workflows/test.yml
vendored
Normal file
29
.github/workflows/test.yml
vendored
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
name: Lint and test
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
- develop
|
||||||
|
pull_request:
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
name: Lint and test
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Setup Go
|
||||||
|
uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: 1.16.x
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt update -qq
|
||||||
|
sudo apt install -y -qq build-essential git sqlite libtag1-dev ffmpeg libasound-dev
|
||||||
|
- name: Lint
|
||||||
|
uses: golangci/golangci-lint-action@v2
|
||||||
|
with:
|
||||||
|
version: latest
|
||||||
|
skip-go-installation: true
|
||||||
|
- name: Test
|
||||||
|
run: go test ./...
|
||||||
@@ -15,6 +15,7 @@ COPY . .
|
|||||||
RUN GOOS=linux go build -o gonic cmd/gonic/gonic.go
|
RUN GOOS=linux go build -o gonic cmd/gonic/gonic.go
|
||||||
|
|
||||||
FROM alpine:3.13.1
|
FROM alpine:3.13.1
|
||||||
|
LABEL org.opencontainers.image.source https://github.com/sentriz/gonic
|
||||||
RUN apk add -U --no-cache \
|
RUN apk add -U --no-cache \
|
||||||
ffmpeg \
|
ffmpeg \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
|
|||||||
Reference in New Issue
Block a user