Skip to content

Commit f389d21

Browse files
ci: release process
1 parent bde628c commit f389d21

File tree

2 files changed

+67
-1
lines changed

2 files changed

+67
-1
lines changed

.github/workflows/release.yaml

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*.*.*'
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
packages: write
14+
15+
steps:
16+
- name: Generate GitHub token
17+
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2
18+
id: generate-github-token
19+
with:
20+
app_id: ${{ secrets.RELEASE_BOT_APP_ID }}
21+
private_key: ${{ secrets.RELEASE_BOT_PRIVATE_KEY }}
22+
23+
- name: Checkout code
24+
uses: actions/checkout@v4
25+
with:
26+
ref: main
27+
token: ${{ steps.generate-github-token.outputs.token }}
28+
fetch-tags: true
29+
30+
- name: Bump version in plugin.yaml
31+
run: |
32+
VERSION=$(echo ${GITHUB_REF#refs/tags/})
33+
sed -i "s/version:.*/version: $VERSION/" plugin.yaml
34+
git config --global user.name 'github-actions'
35+
git config --global user.email 'github-actions@github.com'
36+
git add plugin.yaml
37+
git commit -m "Bump version to $VERSION"
38+
git tag -d $VERSION
39+
git push --delete origin $VERSION
40+
git tag $VERSION
41+
git push origin HEAD:main --tags
42+
env:
43+
GH_TOKEN: '${{ steps.generate-github-token.outputs.token }}'
44+
45+
46+
- uses: ncipollo/release-action@v1
47+
name: Create GitHub Release
48+
id: create_release
49+
with:
50+
tag: ${{ github.ref }}
51+
name: ${{ github.ref }}
52+
token: ${{ steps.generate-github-token.outputs.token }}
53+
54+
- name: Login to GitHub Container Registry
55+
uses: docker/login-action@v3
56+
with:
57+
registry: ghcr.io
58+
username: ${{ github.actor }}
59+
password: ${{ secrets.GITHUB_TOKEN }}
60+
61+
- name: Build and push
62+
uses: docker/build-push-action@v6
63+
with:
64+
context: .
65+
push: true
66+
tags: ghcr.io/jessesimpson36/yamldiff:${{ github.ref_name }}

plugin.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: "yamldiff"
2-
version: "0.0.3"
2+
version: 0.0.4
33
usage: "Gets the differences between a helm values.yaml file and the upstream"
44
description: "Gets the differences between a helm values.yaml file and the upstream"
55
ignoreFlags: false

0 commit comments

Comments
 (0)