-
Notifications
You must be signed in to change notification settings - Fork 1
84 lines (69 loc) · 2.42 KB
/
release.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
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
name: releaser
on:
push:
tags:
- 'v*.*.*'
permissions:
contents: read
jobs:
releaser:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: ncipollo/release-action@v1
with:
generateReleaseNotes: true
- uses: anchore/sbom-action@v0
build-and-publish-oci:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.21'
- name: Convert Repository Name to Lowercase
id: lowercase
run: echo "::set-output name=name::$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')"
- name: Extract Version
id: tagger
uses: battila7/get-version-action@v2
- name: Print Version
run: |
echo ${{steps.tagger.outputs.version}}
echo ${{steps.tagger.outputs.version-without-v}}
- name: Install Cosign
uses: sigstore/cosign-installer@v3.1.1
with:
cosign-release: 'v2.2.2'
- name: Build the OCI Image
run: docker build -t ghcr.io/${{ steps.lowercase.outputs.name }}:${{ steps.tagger.outputs.version-without-v }} .
working-directory: .
- name: Login to GitHub Packages
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Push the OCI Image
run: docker push ghcr.io/${{ steps.lowercase.outputs.name }}:${{ steps.tagger.outputs.version-without-v }}
- name: Sign image with Cosign
run: |
cosign sign --yes --key env://COSIGN_PRIVATE_KEY "ghcr.io/${{ steps.lowercase.outputs.name }}:${{ steps.tagger.outputs.version-without-v }}"
env:
COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
- name: helmify
run: pwd && ls -lah && make helm
- name: Chart | Push
uses: appany/helm-oci-chart-releaser@v0.3.0
with:
name: khaos
repository: ${{ github.repository }}/helm-charts
tag: ${{ steps.tagger.outputs.version-without-v }}
path: charts
registry: ghcr.io
registry_username: ${{ github.repository_owner }}
registry_password: ${{ secrets.GITHUB_TOKEN }}