mirror of
https://github.com/itzg/mc-router.git
synced 2024-11-24 11:55:24 +01:00
ci: Changed to multiarch build of amd64, arm64, arm32v6
This commit is contained in:
parent
c7aa9504f4
commit
44d4766f60
@ -1,51 +0,0 @@
|
||||
version: 2
|
||||
|
||||
defaults: &defaults
|
||||
docker:
|
||||
# specify the version
|
||||
- image: circleci/golang:1.14.4
|
||||
|
||||
jobs:
|
||||
build:
|
||||
<<: *defaults
|
||||
steps:
|
||||
- checkout
|
||||
|
||||
- restore_cache:
|
||||
keys:
|
||||
- cache-{{ arch }}-{{ .Branch }}-{{ checksum "go.sum" }}
|
||||
- cache-{{ arch }}-{{ .Branch }}
|
||||
- cache
|
||||
|
||||
- run: make test
|
||||
|
||||
- save_cache:
|
||||
key: cache-{{ arch }}-{{ .Branch }}-{{ checksum "go.sum" }}
|
||||
paths:
|
||||
- /go/pkg
|
||||
|
||||
release:
|
||||
<<: *defaults
|
||||
steps:
|
||||
- checkout
|
||||
|
||||
- setup_remote_docker
|
||||
- run: echo $DOCKER_PASSWORD | docker login -u $DOCKER_USER --password-stdin
|
||||
- run: make release
|
||||
|
||||
workflows:
|
||||
version: 2
|
||||
incremental:
|
||||
jobs:
|
||||
- build:
|
||||
filters:
|
||||
tags:
|
||||
ignore: /^\d+\.\d+\.\d+/
|
||||
release:
|
||||
jobs:
|
||||
- release:
|
||||
filters:
|
||||
tags:
|
||||
only: /^\d+\.\d+\.\d+(-\d+)?/
|
||||
branches:
|
||||
ignore: /.*/
|
37
.github/workflows/release.yml
vendored
Normal file
37
.github/workflows/release.yml
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
name: release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "[0-9]+.[0-9]+.[0-9]+"
|
||||
- "[0-9]+.[0-9]+.[0-9]+-*"
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-20.04
|
||||
env:
|
||||
DOCKER_CLI_EXPERIMENTAL: "enabled"
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: 1.15
|
||||
|
||||
- name: Docker login
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Run GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v2
|
||||
with:
|
||||
version: latest
|
||||
args: release --rm-dist
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
@ -16,8 +16,8 @@ builds:
|
||||
- windows
|
||||
goarch:
|
||||
- amd64
|
||||
goarm:
|
||||
- "6"
|
||||
- arm64
|
||||
- arm
|
||||
main: ./cmd/mc-router
|
||||
binary: mc-router
|
||||
env:
|
||||
@ -28,18 +28,50 @@ archives:
|
||||
format_overrides:
|
||||
- goos: windows
|
||||
format: zip
|
||||
name_template: '{{ .Binary }}_{{.Version}}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
|
||||
files:
|
||||
- LICENSE*
|
||||
- README*
|
||||
snapshot:
|
||||
name_template: SNAPSHOT-{{ .Commit }}
|
||||
name_template: SNAPSHOT-{{ .ShortCommit }}
|
||||
dockers:
|
||||
- image_templates:
|
||||
- "itzg/mc-router:latest"
|
||||
- "itzg/mc-router:{{.Tag}}"
|
||||
goos: linux
|
||||
- "itzg/{{ .ProjectName }}:{{ .Version }}-amd64"
|
||||
- "itzg/{{ .ProjectName }}:latest"
|
||||
goarch: amd64
|
||||
build_flag_templates:
|
||||
- --platform
|
||||
- linux/amd64
|
||||
- --label=org.opencontainers.image.version={{ .Version }}
|
||||
- --label=org.opencontainers.image.revision={{ .FullCommit }}
|
||||
binaries:
|
||||
- mc-router
|
||||
- image_templates:
|
||||
- "itzg/{{ .ProjectName }}:{{ .Version }}-arm64"
|
||||
goarch: arm64
|
||||
binaries:
|
||||
- mc-router
|
||||
build_flag_templates:
|
||||
- --platform
|
||||
- linux/arm64
|
||||
- --label=org.opencontainers.image.version={{ .Version }}
|
||||
- --label=org.opencontainers.image.revision={{ .FullCommit }}
|
||||
- image_templates:
|
||||
- "itzg/{{ .ProjectName }}:{{ .Version }}-arm32v6"
|
||||
goarch: arm
|
||||
goarm: "6"
|
||||
build_flag_templates:
|
||||
- --platform
|
||||
- linux/arm/v6
|
||||
- --label=org.opencontainers.image.version={{ .Version }}
|
||||
- --label=org.opencontainers.image.revision={{ .FullCommit }}
|
||||
binaries:
|
||||
- mc-router
|
||||
docker_manifests:
|
||||
- name_template: "itzg/{{ .ProjectName }}:{{ .Version }}"
|
||||
image_templates:
|
||||
- "itzg/{{ .ProjectName }}:{{ .Version }}-amd64"
|
||||
- "itzg/{{ .ProjectName }}:{{ .Version }}-arm64"
|
||||
- "itzg/{{ .ProjectName }}:{{ .Version }}-arm32v6"
|
||||
changelog:
|
||||
filters:
|
||||
exclude:
|
||||
|
@ -1,3 +1,8 @@
|
||||
FROM scratch
|
||||
|
||||
LABEL org.opencontainers.image.authors="Geoff Bourne <itzgeoff@gmail.com>"
|
||||
LABEL org.opencontainers.image.title="mc-router"
|
||||
LABEL org.opencontainers.image.source="https://github.com/itzg/mc-router"
|
||||
|
||||
COPY mc-router /
|
||||
ENTRYPOINT ["/mc-router"]
|
||||
ENTRYPOINT ["/mc-router"]
|
||||
|
Loading…
Reference in New Issue
Block a user