forked from WireGuard/wireguard-go
-
Notifications
You must be signed in to change notification settings - Fork 255
56 lines (49 loc) · 1.38 KB
/
container-image.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Container Image
on:
push:
branches:
- master
- main
tags:
- v**
release:
types: [published]
workflow_dispatch:
permissions:
contents: read
packages: write
jobs:
build-publish:
name: Build and publish container image
runs-on: ubuntu-latest
env:
CGO_ENABLED: 0
PLATFORMS: linux/arm/v7,linux/arm64,linux/amd64
steps:
- name: Checkout codebase
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
check-latest: true
- name: Setup `ko`
# The latest (@v0.6) version of this workflow has bug if there are uppercase letters in repo name
uses: ko-build/setup-ko@main
- name: Extract metadata
uses: docker/metadata-action@v5
id: meta
with:
# The images doesn't required, as only tags needed for the ko build step.
images: ""
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
type=sha,format=long
- name: Build and push image
env:
TAGS: ${{ steps.meta.outputs.tags }}
run: ko build ./cmd/warp-plus --platform "${PLATFORMS}" --bare --tags $(echo $TAGS | tr ' ' ',')