diff --git a/.github/configs/cr.yaml b/.github/configs/cr.yaml new file mode 100644 index 00000000..bc9bb2ae --- /dev/null +++ b/.github/configs/cr.yaml @@ -0,0 +1,3 @@ +pages-branch: gh-pages +release-name-template: "v{{ .Version }}" +release-notes-file: CHANGELOG.md \ No newline at end of file diff --git a/.github/workflows/helm-chart-release.yaml b/.github/workflows/helm-chart-release.yaml new file mode 100644 index 00000000..b0173b40 --- /dev/null +++ b/.github/workflows/helm-chart-release.yaml @@ -0,0 +1,56 @@ +name: Release Helm Chart + +on: + push: + branches: + - main + paths: + - 'helm/**' + +jobs: + release: + if: false + permissions: + contents: write + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Install Helm + if: true + uses: azure/setup-helm@v3 + with: + token: ${{ github.token }} + + - name: Add dependencies + if: true + run: | + helm repo add bitnami https://charts.bitnami.com/bitnami + + - name: Configure git + run: | + git config user.name "${{ github.actor }}" + git config user.email "${{ github.actor }}@users.noreply.github.com" + + - name: Semantic Release + id: semantic-release + uses: cycjimmy/semantic-release-action@v4 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + semantic_version: 19.0.5 + branch: main + extra_plugins: | + semantic-release-helm3@2.9.3 + + - name: Run chart-releaser + uses: helm/chart-releaser-action@v1.6.0 + env: + CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + with: + charts_dir: helm + config: .github/configs/cr.yaml + skip_existing: true diff --git a/.github/workflows/lint-pr.yaml b/.github/workflows/lint-pr.yaml new file mode 100644 index 00000000..ee2a0bc1 --- /dev/null +++ b/.github/workflows/lint-pr.yaml @@ -0,0 +1,20 @@ +name: "Lint PR" + +on: + pull_request_target: + types: + - opened + - edited + - synchronize + +permissions: + pull-requests: read + +jobs: + main: + name: Validate PR title + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@v5 + env: + GITHUB_TOKEN: ${{ github.token }} diff --git a/.releaserc b/.releaserc new file mode 100644 index 00000000..bb5f9d3b --- /dev/null +++ b/.releaserc @@ -0,0 +1,39 @@ +{ + "branches": ["main"], + "plugins": [ + [ + "@semantic-release/commit-analyzer", + { + "preset": "angular", + "parserOpts": { + "noteKeywords": ["BREAKING CHANGE", "BREAKING CHANGES", "BREAKING"] + } + } + ], + [ + "@semantic-release/release-notes-generator", + { + "preset": "angular", + "parserOpts": { + "noteKeywords": ["BREAKING CHANGE", "BREAKING CHANGES", "BREAKING"] + }, + "writerOpts": { + "commitsSort": ["subject", "scope"] + } + } + ], + [ + '@semantic-release/changelog', + { + "changelogFile": 'helm/flowforge/CHANGELOG.md' + } + ], + [ + 'semantic-release-helm3', + { + chartPath: 'helm/flowforge', + onlyUpdateVersion: true + } + ] + ] +}