Skip to content

Commit 57ed4f6

Browse files
nixpanicmergify[bot]
authored andcommitted
build: add a job to publish a release by tag
When a tag is pushed into the repository, a release is now automatically made from the tag. The release includes generated YAML files that can be applied with `kubectl` to install the controller and CRDs. Fixes: #107 See-also: https://github.com/ncipollo/release-action/ Signed-off-by: Niels de Vos <ndevos@redhat.com>
1 parent 383733b commit 57ed4f6

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

.github/workflows/tag-release.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,29 @@ jobs:
9898
platforms: linux/amd64,linux/arm64,linux/arm/v7
9999
push: true
100100
tags: quay.io/csiaddons/k8s-sidecar:${{ github.ref_name }}
101+
102+
publish_release:
103+
name: Publish a release based on the tag
104+
if: github.repository == 'csi-addons/kubernetes-csi-addons' && github.ref_type == 'tag'
105+
runs-on: ubuntu-latest
106+
permissions:
107+
contents: write
108+
steps:
109+
- name: Check out the repo
110+
uses: actions/checkout@v2
111+
112+
- name: Install Go 1.17
113+
uses: actions/setup-go@v2
114+
with:
115+
go-version: '1.17'
116+
117+
- name: Generate manifests for installation by kubectl
118+
run: make manifests TAG=${{ github.ref_name }}
119+
120+
- name: Publish the release and attach YAML files
121+
uses: ncipollo/release-action@v1
122+
with:
123+
tag: ${{ github.ref_name }}
124+
artifacts: "deploy/*/*.yaml"
125+
generateReleaseNotes: true
126+
token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)