Release v0.5.5 (#191) #54
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Version-Checker Release | |
on: | |
push: | |
branches: | |
- "release-v*" | |
tags: | |
- "*" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
prepair-release: | |
# Don't push back to a tag! | |
if: ${{ !startsWith(github.ref, 'refs/tags/') }} | |
name: Prepair release | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: write | |
contents: write | |
steps: | |
- uses: actions/checkout@v2 | |
- 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}}" | |
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}}" | |
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}}" | |
include: "Makefile" | |
regex: true | |
- name: Detect any Local Changes | |
uses: dorny/paths-filter@v2 | |
id: filter | |
with: | |
base: HEAD | |
filters: | | |
versions: | |
- 'Makefile' | |
- 'deploy/yaml/deploy.yaml' | |
- 'deploy/charts/version-checker/Chart.yaml' | |
- name: Commit files | |
if: steps.filter.outputs.versions == 'true' | |
run: | | |
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}} " | |
- name: Push changes | |
if: steps.filter.outputs.versions == 'true' | |
uses: ad-m/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.ref_name }} | |
- name: Create Release PR | |
uses: devops-infra/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
target_branch: main | |
title: "Release ${{steps.release_number.outputs.substring}}" | |
body: "**Automated Release Pull Request**" | |
draft: false | |
get_diff: false | |
allow_no_diff: false | |
helm-release: | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout our Repo | |
- uses: actions/checkout@v3 | |
with: | |
path: version-checker | |
- name: checkout jetstack-charts | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.JETSTACK_CHARTS_PAT }} | |
repository: jetstack/jetstack-charts | |
ref: main | |
path: jetstack-charts | |
- uses: azure/setup-helm@v3 | |
with: | |
token: ${{ github.token }} | |
- name: package helm chart | |
run: | | |
helm package version-checker/deploy/charts/version-checker -d jetstack-charts/charts/ | |
- name: Creating PR | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: peter-evans/create-pull-request@v5 | |
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}} | |
path: jetstack-charts | |
add-paths: charts/*.tgz | |
delete-branch: true | |
signoff: true | |
base: main | |
draft: ${{ !startsWith(github.ref, 'refs/tags/') }} | |
docker-release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
with: | |
platforms: ${{ matrix.platform }} | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
registry: quay.io | |
username: ${{ secrets.QUAY_USERNAME }} | |
password: ${{ secrets.QUAY_ROBOT_TOKEN }} | |
- name: Build and push (if applicable) | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64,linux/arm/v7 | |
push: ${{ startsWith(github.ref, 'refs/tags/') }} | |
pull: true | |
tags: quay.io/jetstack/version-checker:${{github.ref_name}} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
github-release: | |
name: Create/Update GitHub Release | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Create Release / Change Logs | |
uses: softprops/action-gh-release@v1 | |
with: | |
draft: ${{ !startsWith(github.ref, 'refs/tags/') }} | |
prerelease: ${{ contains('-rc', github.ref_name) || !startsWith(github.ref, 'refs/tags/') }} | |
generate_release_notes: true |