mirror of
https://github.com/kairos-io/osbuilder.git
synced 2025-07-31 23:25:20 +00:00
update cd workflow
This commit is contained in:
parent
5fef878b67
commit
a3ba1f5c15
69
.github/workflows/cd.yml
vendored
69
.github/workflows/cd.yml
vendored
@ -59,28 +59,63 @@ jobs:
|
|||||||
build-args: |
|
build-args: |
|
||||||
GIT_COMMIT=${{ github.sha }}
|
GIT_COMMIT=${{ github.sha }}
|
||||||
release:
|
release:
|
||||||
name: Release Helm Chart and Create Github Release
|
name: Create GitHub release
|
||||||
if: startsWith(github.ref, 'refs/tags/') # Limit job to tag pushes
|
if: startsWith(github.ref, 'refs/tags/') # Limit job to tag pushes
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
needs: publish
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
runs-on: ubuntu-latest
|
discussions: write
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Release
|
||||||
|
uses: softprops/action-gh-release@v1
|
||||||
|
with:
|
||||||
|
generate_release_notes: true
|
||||||
|
draft: false
|
||||||
|
bump:
|
||||||
|
name: Bump Chart Version
|
||||||
|
if: startsWith(github.ref, 'refs/tags/') # Limit job to tag pushes
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
needs: [release]
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
discussions: write
|
||||||
|
pull-requests: write
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
persist-credentials: false
|
||||||
|
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
|
||||||
- name: Configure Git
|
- uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version: "1.23.3"
|
||||||
|
- name: Push Chart
|
||||||
|
uses: pluralsh/chart-releaser@v0.1.3
|
||||||
|
with:
|
||||||
|
path: ./charts/osbuilder
|
||||||
|
release: ${{github.ref_name}}
|
||||||
|
- name: Read Chart Version
|
||||||
|
id: chart_version
|
||||||
|
uses: mikefarah/yq@master
|
||||||
|
with:
|
||||||
|
cmd: yq ".version" charts/osbuilder/Chart.yaml
|
||||||
|
- name: Update Chart Version
|
||||||
|
uses: mikefarah/yq@master
|
||||||
|
with:
|
||||||
|
cmd: yq -i '.dependencies[] |= select(.name == "controller").version="${{ steps.chart_version.outputs.result }}"' charts/osbuilder/Chart.yaml
|
||||||
|
- name: Helm Dependencies
|
||||||
run: |
|
run: |
|
||||||
git config user.name "$GITHUB_ACTOR"
|
cd charts/osbuilder
|
||||||
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
|
helm update dependencies
|
||||||
|
- name: Create Pull Request
|
||||||
- name: Install Helm
|
uses: peter-evans/create-pull-request@v5
|
||||||
uses: azure/setup-helm@v4
|
with:
|
||||||
env:
|
title: Release ${{github.ref_name}}
|
||||||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
body: Automated Pull Request to release ${{github.ref_name}}
|
||||||
|
commit-message: Updated chart to release ${{github.ref_name}}
|
||||||
- name: Run chart-releaser
|
branch: release-${{github.ref_name}}
|
||||||
uses: helm/chart-releaser-action@v1.6.0
|
labels: release
|
||||||
env:
|
base: master
|
||||||
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
|
Loading…
Reference in New Issue
Block a user