-
Notifications
You must be signed in to change notification settings - Fork 0
115 lines (98 loc) · 3.67 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
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
name: Release
on:
workflow_dispatch:
inputs:
tag:
description: "Tag to be released (e.g., v1.0.0)"
required: true
all_platforms:
description: "Build for all platforms (linux/amd64,linux/arm64) or just linux/amd64"
required: false
type: boolean
default: false
jobs:
prod-container-build:
permissions:
contents: read
packages: write
uses: scality/workflows/.github/workflows/docker-build.yaml@v2
with:
context: .
name: cosi-driver
namespace: ${{ github.repository_owner }}
tag: ${{ inputs.tag }}
platforms: ${{ inputs.all_platforms && 'linux/amd64,linux/arm64' || 'linux/amd64' }}
create-docker-info:
runs-on: ubuntu-latest
needs: prod-container-build
steps:
- name: Create Docker Image Info File
run: echo "Docker image - ghcr.io/${{ github.repository_owner }}/cosi:${{ inputs.tag }}" > docker-image-info.txt
- name: Upload Docker Info as Artifact
uses: actions/upload-artifact@v4
with:
name: docker-image-info
path: docker-image-info.txt
create-github-release:
runs-on: ubuntu-latest
needs: [create-docker-info, package-helm-chart]
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Download Helm Chart Artifact
uses: actions/download-artifact@v4
with:
name: helm-chart
- name: Download Docker Info Artifact
uses: actions/download-artifact@v4
with:
name: docker-image-info
- name: Upload Assets and Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: |
docker-image-info.txt
scality-cosi-driver-${{ inputs.tag }}.tgz
tag_name: ${{ inputs.tag }}
name: Release ${{ inputs.tag }}
body: "Release for tag ${{ inputs.tag }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
package-helm-chart:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Helm
uses: azure/[email protected]
with:
version: v3.16.2
- name: login to ghcr.io with helm
run: helm registry login -u actions -p ${{ github.token }} ghcr.io
- name: Package Helm Chart
run: |
helm package ./helm/scality-cosi-driver --version ${{ inputs.tag }} --app-version ${{ inputs.tag }}
- name: Upload Helm Chart as Artifact
uses: actions/upload-artifact@v4
with:
name: helm-chart
path: scality-cosi-driver-${{ inputs.tag }}.tgz
- name: Upload Assets and Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: |
docker-image-info.txt
scality-cosi-driver-${{ inputs.tag }}.tgz
tag_name: ${{ inputs.tag }}
name: Release ${{ inputs.tag }}
body: "Release for tag ${{ inputs.tag }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Push helm chart to ghcr.io
run: helm push scality-cosi-driver-${{ inputs.tag }}.tgz oci://ghcr.io/${{ github.repository }}/helm-charts
- name: Pull the helm chart
run: helm pull oci://ghcr.io/${{ github.repository }}/helm-charts/scality-cosi-driver --version ${{ inputs.tag }}
- name: Show the helm chart
run: helm show all oci://ghcr.io/${{ github.repository }}/helm-charts/scality-cosi-driver --version ${{ inputs.tag }}
- name: Template the helm chart
run: helm template oci://ghcr.io/${{ github.repository }}/helm-charts/scality-cosi-driver --version ${{ inputs.tag }}