Skip to content

Commit

Permalink
build: add a job to publish a release by tag
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
nixpanic authored and mergify[bot] committed Feb 2, 2022
1 parent 383733b commit 57ed4f6
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/tag-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,29 @@ jobs:
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: quay.io/csiaddons/k8s-sidecar:${{ github.ref_name }}

publish_release:
name: Publish a release based on the tag
if: github.repository == 'csi-addons/kubernetes-csi-addons' && github.ref_type == 'tag'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check out the repo
uses: actions/checkout@v2

- name: Install Go 1.17
uses: actions/setup-go@v2
with:
go-version: '1.17'

- name: Generate manifests for installation by kubectl
run: make manifests TAG=${{ github.ref_name }}

- name: Publish the release and attach YAML files
uses: ncipollo/release-action@v1
with:
tag: ${{ github.ref_name }}
artifacts: "deploy/*/*.yaml"
generateReleaseNotes: true
token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 57ed4f6

Please sign in to comment.