Skip to content

Commit

Permalink
github action update
Browse files Browse the repository at this point in the history
  • Loading branch information
RVANDO12 committed Sep 22, 2023
1 parent e123342 commit 8a8c907
Showing 1 changed file with 84 additions and 0 deletions.
84 changes: 84 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Release Charts v2

on:
push:
branches:
- main
paths:
- 'charts/stable/**'
workflow_dispatch:
inputs:
copy:
description: 'Copy candidate before running the release pipeline'
required: true
default: 'true'
jobs:
copy-candidate:
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.copy == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
token: ${{ secrets.PAT_TOKEN }}
- name: Copy candidate to stable version
working-directory: code
run: make copy-candidate-to-stable
- uses: EndBug/add-and-commit@v7
with:
add: 'charts/stable'
branch_mode: throw
message: 'chore(charts): candidate to stable [skip ci]'
pathspec_error_handling: exitImmediately
pull: '--rebase --autostash'
default_author: github_actions
release:
needs: copy-candidate
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ github.ref }}
- name: Install Helm
uses: azure/setup-helm@v1
with:
version: v3.4.0
- id: version
name: Get version
working-directory: code
run: |
FROM_TAG=$(git describe --tags --abbrev=0 --match "ara-stable-v*")
CHART_VERSION=$(make -s get-chart-version TARGET_CHART=stable)
echo ::set-output name=stable::${CHART_VERSION}
echo ::set-output name=fromTag::${FROM_TAG}
- uses: octokit/[email protected]
id: generate_changelog
with:
route: POST /repos/{owner}/{repo}/releases/generate-notes
owner: Decathlon
repo: ara
tag_name: ara-stable-v${{ steps.version.outputs.stable }}
previous_tag_name: ${{ steps.version.outputs.fromTag }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Changelog file
working-directory: charts/stable
run: |
cat <<EOF >CHANGELOG.md
${{ fromJson(steps.generate_changelog.outputs.data).body }}
EOF
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Run chart-releaser
uses: Thomgrus/chart-releaser-action@feat/manage-chart-by-chart-diff
with:
config: .github/cr-config.yaml
version: v1.3.0
charts_dir: charts/stable
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

0 comments on commit 8a8c907

Please sign in to comment.