This commit is contained in:
Vladislav Yarmak 2023-10-07 20:23:50 +03:00
parent 5e6a7ddf6e
commit 2581ac09f9
2 changed files with 58 additions and 17 deletions

37
.github/workflows/build.yml vendored Normal file
View file

@ -0,0 +1,37 @@
name: build
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
-
name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
-
name: Setup Go
uses: actions/setup-go@v4
with:
go-version: 'stable'
-
name: Build
run: >-
make -j $(nproc) allplus
NDK_CC_ARM64="$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang"
NDK_CC_ARM="$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi21-clang"
-
name: Release
uses: softprops/action-gh-release@v1
with:
files: bin/*
fail_on_unmatched_files: true
generate_release_notes: true

View file

@ -2,10 +2,8 @@ name: docker-ci
on: on:
push: push:
branches: tags:
- 'master' - 'v*.*.*'
release:
types: [published]
jobs: jobs:
docker: docker:
@ -13,7 +11,7 @@ jobs:
steps: steps:
- -
name: Checkout name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
- -
@ -26,33 +24,39 @@ jobs:
commit-ish: 'HEAD' commit-ish: 'HEAD'
skip-unshallow: 'true' skip-unshallow: 'true'
abbrev: 7 abbrev: 7
- - name: Docker meta
name: Determine image tag type id: meta
uses: haya14busa/action-cond@v1 uses: docker/metadata-action@v5
id: imgtag
with: with:
cond: ${{ github.event_name == 'release' }} # list of Docker images to use as base name for tags
if_true: ${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }}:${{ github.event.release.tag_name }},${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }}:latest images: |
if_false: ${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }}:latest ${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }}
# generate Docker tags based on the following events/attributes
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- -
name: Set up QEMU name: Set up QEMU
uses: docker/setup-qemu-action@v1 uses: docker/setup-qemu-action@v3
- -
name: Set up Docker Buildx name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1 uses: docker/setup-buildx-action@v3
- -
name: Login to DockerHub name: Login to DockerHub
uses: docker/login-action@v1 uses: docker/login-action@v3
with: with:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
- -
name: Build and push name: Build and push
id: docker_build id: docker_build
uses: docker/build-push-action@v2 uses: docker/build-push-action@v5
with: with:
context: . context: .
platforms: linux/amd64,linux/arm64,linux/386,linux/arm/v7 platforms: linux/amd64,linux/arm64,linux/386,linux/arm/v7
push: true push: true
tags: ${{ steps.imgtag.outputs.value }} tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: 'GIT_DESC=${{steps.tagger.outputs.tag}}' build-args: 'GIT_DESC=${{steps.tagger.outputs.tag}}'