-
Notifications
You must be signed in to change notification settings - Fork 10
107 lines (102 loc) · 4.27 KB
/
release.yaml
File metadata and controls
107 lines (102 loc) · 4.27 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
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: release
permissions: {}
on:
push:
tags:
- v*
jobs:
github:
runs-on: ubuntu-latest
permissions:
contents: write # needed to write releases
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Parse version
id: version
uses: booxmedialtd/ws-action-parse-semver@7784200024d6b3fc01253e617ec0168daf603de3 # v1.4.7
with:
input_string: ${{ github.ref_name }}
version_extractor_regex: ^v(.*)$
- uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
generate_release_notes: true
make_latest: ${{ steps.version.outputs.prerelease == '' }}
prerelease: ${{ steps.version.outputs.prerelease != '' }}
fail_on_unmatched_files: true
files: |
config/install.yaml
config/crd/openreports.io_clusterreports.yaml
config/crd/openreports.io_reports.yaml
manifests:
runs-on: ubuntu-latest
needs:
- github
permissions:
id-token: write # needed for keyless signing
packages: write # needed for ghcr access
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install Cosign
uses: sigstore/cosign-installer@faadad0cce49287aee09b3a48701e75088a2c6ad # v4.0.0
- name: Install Flux CLI
uses: fluxcd/flux2/action@97222a775ae8e68f1e85508f356f248704255c9c # v2.8.1
- name: Login to GHCR
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push manifests to GHCR with Flux
env:
CR_PAT_ARTIFACTS: ${{ secrets.GITHUB_TOKEN }}
run: |
set -e
flux push artifact oci://ghcr.io/${{ github.repository_owner }}/manifests/openreports:${{ github.ref_name }} \
--path=config/install.yaml \
--source=$(git config --get remote.origin.url) \
--revision=${{ github.ref_name }}/$(git rev-parse HEAD)
- name: Sign manifests in GHCR with Cosign
run: |
cosign sign --yes ghcr.io/${{ github.repository_owner }}/manifests/openreports:${{ github.ref_name }}
helm:
runs-on: ubuntu-latest
needs:
- github
permissions:
contents: write # needed to write releases
id-token: write # needed for keyless signing
packages: write # needed for ghcr access
pages: write # needed for pages access
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install helm
uses: azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4 # v4.3.1
- name: Install Cosign
uses: sigstore/cosign-installer@faadad0cce49287aee09b3a48701e75088a2c6ad # v4.0.0
- name: Parse version
id: version
uses: booxmedialtd/ws-action-parse-semver@7784200024d6b3fc01253e617ec0168daf603de3 # v1.4.7
with:
input_string: ${{ github.ref_name }}
version_extractor_regex: ^v(.*)$
- name: Run chart-releaser
uses: stefanprodan/helm-gh-pages@0ad2bb377311d61ac04ad9eb6f252fb68e207260 #v1.7.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
linting: off
charts_dir: charts
chart_version: ${{ steps.version.outputs.fullversion }}
- name: Login to GitHub container registry
run: |
helm registry login ghcr.io -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }}
- name: Publish OCI Chart
run: |
helm package charts/openreports --version ${{ steps.version.outputs.fullversion }} --destination .dist/
helm push .dist/openreports-*.tgz oci://ghcr.io/${{ github.repository_owner }}/charts |& tee .digest
cosign login --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} ghcr.io
cosign sign --yes ghcr.io/${{ github.repository_owner }}/charts/openreports@$(cat .digest | awk -F "[, ]" '/Digest/{print $NF}')