-
Notifications
You must be signed in to change notification settings - Fork 1
136 lines (129 loc) · 3.56 KB
/
Copy pathrelease.yml
File metadata and controls
136 lines (129 loc) · 3.56 KB
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
---
name: release
on:
push:
tags:
- 'v*'
env:
IMAGE_NAME: ceph
CEPH_SOURCE_IMAGE: quay.io/ceph/ceph
jobs:
hadolint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: hadolint/hadolint-action@v3.3.0
with:
dockerfile: Dockerfile
markdownlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: articulate/actions-markdownlint@v1
unittests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version: '1.26.x'
- name: Install dependencies
run: go mod download
- name: Test with the Go CLI
run: go test ./...
- name: Build
run: go build -v ./...
build-binaries:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
needs:
- hadolint
- markdownlint
- unittests
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
fetch-tags: true
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version: '1.26.x'
- name: Install dependencies
run: go mod download
- name: Build & Publish release release
uses: goreleaser/goreleaser-action@v7
with:
distribution: goreleaser
version: '~> v2'
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload cephctl binaries
uses: actions/upload-artifact@v7
with:
name: cephctl-binaries
path: dist
build-container-images:
strategy:
matrix:
version:
- '18.2.2'
- '18.2.4'
- '18.2.5'
- '18.2.6'
- '18.2.7'
- '18.2.8'
- '19.2.0'
- '19.2.1'
- '19.2.2'
- '19.2.3'
- '20.2.0'
- '20.2.1'
- '20.2.2'
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
needs:
- hadolint
- markdownlint
- unittests
- build-binaries
steps:
- name: Define build timestamp
id: timestamp
run: echo "::set-output name=now::$(date -u +'%Y%m%d%H%M%S')"
- uses: actions/checkout@v7
with:
fetch-depth: 0
fetch-tags: true
- name: Download cephctl binaries
uses: actions/download-artifact@v8
with:
name: cephctl-binaries
path: dist
- name: Login to GHCR
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v7
with:
context: .
build-args: |
CEPH_SOURCE_IMAGE: ${{ env.CEPH_SOURCE_IMAGE }}
CEPH_VERSION=${{ matrix.version }}
file: ./Dockerfile
platforms: amd64
push: true
tags: |
ghcr.io/${{ github.repository }}/${{ env.IMAGE_NAME }}:v${{ matrix.version }}
ghcr.io/${{ github.repository }}/${{ env.IMAGE_NAME }}:v${{ matrix.version }}-${{ github.ref_name }}
ghcr.io/${{ github.repository }}/${{ env.IMAGE_NAME }}:v${{ matrix.version }}-${{ github.ref_name }}-${{ steps.timestamp.outputs.now }}
outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ env.IMAGE_NAME }},annotation-index.org.opencontainers.image.description=${{ env.IMAGE_NAME }}