Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 40 additions & 23 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,23 @@ concurrency:
cancel-in-progress: true

jobs:
release-name:
name: Generate a clean release name from the branch/tag
runs-on: ubuntu-latest
outputs:
name: ${{ steps.release_number.outputs.substring }}
steps:
- uses: bhowell2/[email protected]
id: release_number
with:
value: ${{github.ref_name}}
index_of_str: "release-"

prepare-release:
# Don't push back to a tag!
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
needs:
- release-name
name: Prepare release
runs-on: ubuntu-latest
permissions:
Expand All @@ -23,39 +37,35 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0

- name: Setup Golang
uses: actions/setup-go@v5
with:
go-version-file: go.mod

- uses: bhowell2/[email protected]
id: release_number
with:
value: ${{github.ref_name}}
index_of_str: "release-"

- name: Find and Replace Helm Chart Version
uses: jacobtomlinson/gha-find-replace@v3
with:
find: 'v(\d+)\.(\d+)\.(\d+)(-rc(\d)+)?'
replace: "${{steps.release_number.outputs.substring}}"
replace: "${{needs.release-name.outputs.name}}"
include: "deploy/charts/version-checker/Chart.yaml"
regex: true

- name: Find and Replace Kubernetes Manifests
uses: jacobtomlinson/gha-find-replace@v3
with:
find: 'v(\d+)\.(\d+)\.(\d+)(-rc(\d)+)?'
replace: "${{steps.release_number.outputs.substring}}"
replace: "${{needs.release-name.outputs.name}}"
include: "deploy/yaml/deploy.yaml"
regex: true

- name: Find and Replace Makefile versions
uses: jacobtomlinson/gha-find-replace@v3
with:
find: 'v(\d+)\.(\d+)\.(\d+)(-rc(\d)+)?'
replace: "${{steps.release_number.outputs.substring}}"
replace: "${{needs.release-name.outputs.name}}"
include: "Makefile"
regex: true

Expand Down Expand Up @@ -87,7 +97,7 @@ jobs:
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git status
git commit -a -m "Bump versions to ${{steps.release_number.outputs.substring}} "
git commit -a -m "Bump versions to ${{needs.release-name.outputs.name}}"

- name: Push changes
if: steps.filter.outputs.versions == 'true'
Expand All @@ -105,9 +115,9 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
target_branch: main
title: "Release ${{steps.release_number.outputs.substring}}"
title: "Release ${{needs.release-name.outputs.name}}"
body: |-
"**Automated Release Pull Request**
**Automated Release Pull Request**

## Change log:
${{steps.github_release.outputs.changelog}}
Expand All @@ -119,9 +129,13 @@ jobs:
runs-on: ubuntu-latest
permissions:
id-token: write
needs:
- release-name
steps:
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
path: version-checker

- name: Setup Cosign
uses: sigstore/cosign-installer@main
Expand All @@ -136,10 +150,9 @@ jobs:

- name: Setup Helm
uses: azure/setup-helm@v4
with:
token: ${{ github.token }}

- name: Login to Quay.io
if: startsWith(github.ref, 'refs/tags/')
run: echo "${{ secrets.QUAY_ROBOT_TOKEN }}" | helm registry login quay.io -u ${{ secrets.QUAY_USERNAME }} --password-stdin

- name: package helm chart
Expand All @@ -148,34 +161,36 @@ jobs:

- name: Sign Helm Chart
run: |
cosign sign-blob -y jetstack-charts/charts/version-checker-${{steps.release_number.outputs.substring}}.tgz \
--bundle jetstack-charts/charts/version-checker-${{steps.release_number.outputs.substring}}.tgz.cosign.bundle
cosign sign-blob -y jetstack-charts/charts/version-checker-${{ needs.release-name.outputs.name }}.tgz \
--bundle jetstack-charts/charts/version-checker-${{ needs.release-name.outputs.name }}.tgz.cosign.bundle

- name: Creating PR
if: startsWith(github.ref, 'refs/tags/')
- name: Creating Publishing Chart's PR
uses: peter-evans/create-pull-request@v7
if: ${{ startsWith(github.ref, 'refs/tags/') }}
with:
token: ${{ secrets.JETSTACK_CHARTS_PAT }}
title: "Release version-checker ${{github.ref_name }}"
commit-message: "Release version-checker ${{github.ref_name }}"
branch: version-checker/${{github.ref_name}}
title: "Release version-checker ${{ needs.release-name.outputs.name }}"
commit-message: "Release version-checker ${{ needs.release-name.outputs.name }}"
branch: version-checker/${{ github.ref_name }}
path: jetstack-charts
add-paths: |
charts/*.tgz
charts/*.tgz.cosign.bundle
delete-branch: true
signoff: true
base: main
draft: ${{ !startsWith(github.ref, 'refs/tags/') }}

- name: Push to Quay
if: startsWith(github.ref, 'refs/tags/')
run: |-
helm push jetstack-charts/charts/version-checker-${{ github.ref_name }}.tgz oci://quay.io/quay.io/jetstack/version-checker/chart
helm push jetstack-charts/charts/version-checker-${{ needs.release-name.outputs.name }}.tgz oci://quay.io/quay.io/jetstack/version-checker/chart:${{needs.release-name.outputs.name}}

docker-release:
runs-on: ubuntu-latest
permissions:
id-token: write
needs:
- release-name
steps:
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
Expand Down Expand Up @@ -237,6 +252,8 @@ jobs:
permissions:
contents: write
runs-on: ubuntu-latest
needs:
- release-name
steps:
- name: Create Release / Change Logs
uses: softprops/action-gh-release@v2
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ verify: test build ## tests and builds version-checker

image: ## build docker image
GOARCH=$(ARCH) GOOS=linux CGO_ENABLED=0 go build -o ./bin/version-checker-linux ./cmd/.
docker build -t quay.io/jetstack/version-checker:v0.9.0 .
docker build -t quay.io/jetstack/version-checker:v0.9.1-rc1 .

clean: ## clean up created files
rm -rf \
Expand Down
4 changes: 2 additions & 2 deletions deploy/charts/version-checker/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
appVersion: "v0.9.0"
version: "v0.9.0"
appVersion: "v0.9.1-rc1"
version: "v0.9.1-rc1"
description: A Helm chart for version-checker
home: https://github.com/jetstack/version-checker
name: version-checker
Expand Down
2 changes: 1 addition & 1 deletion deploy/charts/version-checker/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# version-checker

![Version: v0.9.0](https://img.shields.io/badge/Version-v0.9.0-informational?style=flat-square) ![AppVersion: v0.9.0](https://img.shields.io/badge/AppVersion-v0.9.0-informational?style=flat-square)
![Version: v0.9.1-rc1](https://img.shields.io/badge/Version-v0.9.1--rc1-informational?style=flat-square) ![AppVersion: v0.9.1-rc1](https://img.shields.io/badge/AppVersion-v0.9.1--rc1-informational?style=flat-square)

A Helm chart for version-checker

Expand Down
2 changes: 1 addition & 1 deletion deploy/yaml/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ spec:
spec:
serviceAccountName: version-checker
containers:
- image: quay.io/jetstack/version-checker:v0.9.0
- image: quay.io/jetstack/version-checker:v0.9.1-rc1
imagePullPolicy: Always
ports:
- containerPort: 8080
Expand Down
Loading