-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (73 loc) · 2.83 KB
/
release.yml
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: docker image
on:
workflow_dispatch:
inputs:
UBUNTU_VERSION:
description: "base ubuntu version"
required: true
default: "lunar-20230731"
type: string
CLANG_VERSION:
description: "clang apt package version"
required: true
default: "16"
type: string
jobs:
release:
runs-on: ${{ matrix.builder }}
strategy:
matrix:
include:
- builder: ubuntu-latest
platform: amd64
- builder: ubuntu-latest # buildjet-2vcpu-ubuntu-2204-arm
platform: arm64
steps:
- name: Checkout Code
uses: actions/checkout@v1
# not necessary as build is native on ARM
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}
- name: Build and Push Docker Image
uses: docker/build-push-action@v4
with:
file: Dockerfile
push: true
provenance: false # https://github.com/docker/buildx/issues/1608
platforms: linux/${{ matrix.platform }}
build-args: |
UBUNTU_VERSION=${{ inputs.UBUNTU_VERSION }}
CLANG_VERSION=${{ inputs.CLANG_VERSION }}
tags: |
ghcr.io/${{ github.repository_owner }}/clang-tools:latest-${{ matrix.platform }}
ghcr.io/${{ github.repository_owner }}/clang-tools:${{ inputs.CLANG_VERSION }}-${{ matrix.platform }}
manifest:
runs-on: ubuntu-latest
needs: release
steps:
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}
- name: Create and push manifest images for latest
uses: Noelware/docker-manifest-action@56f19b00084cefe1b43752e27025979fa5707a70 #0.3.1
with:
inputs: ghcr.io/${{ github.repository_owner }}/clang-tools:latest
images: ghcr.io/${{ github.repository_owner }}/clang-tools:latest-amd64,ghcr.io/${{ github.repository_owner }}/clang-tools:latest-arm64
push: true
- name: Create and push manifest images for specific version
uses: Noelware/docker-manifest-action@56f19b00084cefe1b43752e27025979fa5707a70 #0.3.1
with:
inputs: ghcr.io/${{ github.repository_owner }}/clang-tools:${{ inputs.CLANG_VERSION }}
images: ghcr.io/${{ github.repository_owner }}/clang-tools:${{ inputs.CLANG_VERSION }}-amd64,ghcr.io/${{ github.repository_owner }}/clang-tools:${{ inputs.CLANG_VERSION }}-arm64
push: true