Skip to content

Commit f90894a

Browse files
authored
feat: Automate Plugin Releases via GitHub Actions (#1425)
feat: Add GitHub Actions workflow for releasing plugin assets in a Github Release
1 parent f830954 commit f90894a

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Plugins Release (Manual)
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: "Version number (e.g v1.0.0)"
8+
required: true
9+
notes:
10+
description: "Release notes (optional)"
11+
required: false
12+
13+
permissions:
14+
contents: write
15+
16+
jobs:
17+
release:
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
24+
- name: Create tar file of the plugins folder
25+
run: |
26+
tar -czvf kubeplus-kubectl-plugins-${{ github.event.inputs.version }}.tar.gz -C plugins .
27+
28+
- name: Create GitHub release and upload asset
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
run: |
32+
NOTES="${{ github.event.inputs.notes }}"
33+
if [ -z "$NOTES" ]; then
34+
NOTES="Release of kubeplus kubectl plugins version ${{ github.event.inputs.version }}"
35+
fi
36+
37+
gh release create kubeplus-kubectl-plugins-${{ github.event.inputs.version }} \
38+
kubeplus-kubectl-plugins-${{ github.event.inputs.version }}.tar.gz \
39+
--title "Release kubeplus-kubectl-plugins-${{ github.event.inputs.version }}" \
40+
--notes "$NOTES"

0 commit comments

Comments
 (0)