Skip to content

Commit 8393c60

Browse files
committed
auto update versions in readme on release
Signed-off-by: Skye Gill <[email protected]>
1 parent d4a969f commit 8393c60

File tree

2 files changed

+60
-11
lines changed

2 files changed

+60
-11
lines changed

.github/workflows/release-tag.yaml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: release-tag
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
with:
15+
submodules: recursive
16+
- name: Get the version
17+
id: get_version
18+
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
19+
20+
- name: Setup Go
21+
uses: actions/setup-go@v3
22+
with:
23+
go-version: '1.17.11'
24+
- run: |
25+
make update-flagd
26+
go mod tidy
27+
make controller-gen
28+
IMG=ghcr.io/open-feature/open-feature-operator:${GITHUB_REF#refs/*/} make release-manifests
29+
30+
- name: Update README.md version
31+
uses: jacobtomlinson/gha-find-replace@v2
32+
with:
33+
find: "https://github\\.com/open-feature/open-feature-operator/releases/download/v[\\d]+\\.[\\d]+\\.[\\d]+"
34+
replace: "https://github.com/open-feature/open-feature-operator/releases/download/${{ steps.get_version.outputs.VERSION }}"
35+
regex: true
36+
include: README.md
37+
38+
- name: Commit files
39+
run: |
40+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
41+
git config --local user.name "github-actions[bot]"
42+
git commit -s -m "Updated README.md version" -a
43+
44+
- name: Push changes
45+
uses: ad-m/[email protected]
46+
with:
47+
github_token: ${{ secrets.GITHUB_TOKEN }}
48+
branch: main
49+
50+
- name: Release
51+
uses: softprops/action-gh-release@v1
52+
with:
53+
files: |
54+
config/webhook/certificate.yaml
55+
config/rendered/release.yaml
56+
config/samples/end-to-end.yaml

.github/workflows/release.yaml renamed to .github/workflows/release-workflow.yaml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
1-
name: release
1+
name: release-workflow
22

33
on:
44
push:
55
branches:
6-
- feature/release-workflow
7-
tags:
8-
- "v*.*.*"
9-
env:
10-
REGISTRY: ghcr.io
11-
IMAGE_NAME: ${{ github.repository }}
12-
FLAGD_VERSION: v0.0.3
6+
- feature/release-workflow
137

148
jobs:
159
build:
@@ -18,11 +12,11 @@ jobs:
1812
- name: Checkout
1913
uses: actions/checkout@v2
2014
with:
21-
submodules: recursive
15+
submodules: recursive
2216
- name: Get the version
2317
id: get_version
2418
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
25-
19+
2620
- uses: actions/setup-go@v3
2721
with:
2822
go-version: '1.17.11'
@@ -31,7 +25,6 @@ jobs:
3125
go mod tidy
3226
make controller-gen
3327
IMG=ghcr.io/open-feature/open-feature-operator:${GITHUB_REF#refs/*/} make release-manifests
34-
3528
- name: Release
3629
uses: softprops/action-gh-release@v1
3730
with:

0 commit comments

Comments
 (0)