diff --git a/.github/release-please/config.json b/.github/release-please/config.json new file mode 100644 index 0000000000..1d594028be --- /dev/null +++ b/.github/release-please/config.json @@ -0,0 +1,37 @@ +{ + "release-type": "helm", + "changelog-sections": [ + { + "type": "feat", + "section": "Features" + }, + { + "type": "fix", + "section": "Bug Fixes" + }, + { + "type": "chore", + "section": "Miscellaneous Chores" + } + ], + "include-component-in-tag": true, + "pull-request-title-pattern": "chore${scope}: [bot] release${component}:${version}", + "separate-pull-requests": true, + "packages": { + "charts/base-cluster": { + "package-name": "base-cluster" + }, + "charts/chirpstack": { + "package-name": "chirpstack" + }, + "charts/stellio-context-broker": { + "package-name": "stellio-context-broker" + }, + "charts/t8s-cluster": { + "package-name": "t8s-cluster" + }, + "charts/teuto-portal-k8s-worker": { + "package-name": "teuto-portal-k8s-worker" + } + } +} diff --git a/.github/release-please/manifest.json b/.github/release-please/manifest.json new file mode 100644 index 0000000000..e69de29bb2 diff --git a/.github/workflows/create-release-pr.yaml b/.github/workflows/create-release-pr.yaml deleted file mode 100644 index e2bd9ba281..0000000000 --- a/.github/workflows/create-release-pr.yaml +++ /dev/null @@ -1,69 +0,0 @@ -name: Create Release PR for chart - -on: - workflow_call: - secrets: - ACTIONS_BOT_TOKEN: - required: true - inputs: - chart: - type: string - required: true - description: The name of the chart to run against - workflow_dispatch: - inputs: - chart: - type: string - required: true - description: The name of the chart to run against - -jobs: - createReleasePR: - runs-on: ubuntu-latest - env: - CT_TARGET_BRANCH: ${{ github.event.repository.default_branch }} - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - id: getLatestReleaseHash - name: Get latest release for the changed chart - env: - chart: ${{ inputs.chart }} - run: | - set -x - set -o pipefail - chart=${chart:?chart variable is empty} - ( - echo "chart=${chart}" - echo -n hash= - ( - curl -H "Authorization: Bearer ${{ secrets.ACTIONS_BOT_TOKEN }}" "${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/releases" \ - | jq -r ".[] | select(.name | startswith(\"${chart}-\")) | \"\\(.published_at)\\t\\(.target_commitish)\"" \ - | sort -k 1 \ - | tail -n 1 \ - | cut -f 2 \ - | grep -E . - ) || ( - git rev-list HEAD "charts/$chart" | tail -n 1 - ) - ) | tee "$GITHUB_OUTPUT" - - - name: Change to github-actions[bot] - run: | - git config user.name github-actions[bot] - git config user.email 41898282+github-actions[bot]@users.noreply.github.com - - - uses: google-github-actions/release-please-action@v3 - with: - path: charts/${{ inputs.chart }} - package-name: ${{ inputs.chart }} - command: release-pr - changelog-types: '[{"type":"feat","section":"Features"},{"type":"fix","section":"Bug Fixes"},{"type":"chore","section":"Miscellaneous Chores"}]' - last-release-sha: ${{ steps.getLatestReleaseHash.outputs.hash }} - monorepo-tags: true - pull-request-title-pattern: "chore${scope}: [bot] release${component}:${version}" - release-type: helm - separate-pull-requests: true - token: ${{ secrets.ACTIONS_BOT_TOKEN }} diff --git a/.github/workflows/create-release-prs.yaml b/.github/workflows/create-release-prs.yaml new file mode 100644 index 0000000000..a7f0a3d56f --- /dev/null +++ b/.github/workflows/create-release-prs.yaml @@ -0,0 +1,20 @@ +name: Create Release PR for charts + +on: + workflow_dispatch: {} + push: + branches: + - main + paths: + - charts/** + +jobs: + createReleasePR: + runs-on: ubuntu-latest + steps: + - uses: google-github-actions/release-please-action@v4 + with: + skip-github-release: true + token: ${{ secrets.ACTIONS_BOT_TOKEN }} + config-file: .github/release-please/config.json + manifest-file: .github/release-please/manifest.json diff --git a/.github/workflows/release-chart.yaml b/.github/workflows/release-chart.yaml index a90764c763..507f9ff304 100644 --- a/.github/workflows/release-chart.yaml +++ b/.github/workflows/release-chart.yaml @@ -34,16 +34,10 @@ jobs: - run: helm package --dependency-update charts/${{ needs.getChangedChart.outputs.chart }} - run: helm registry login ghcr.io --username teutonet-bot --password ${{ secrets.ACTIONS_BOT_TOKEN }} - run: helm push ${{ needs.getChangedChart.outputs.chart }}-* "oci://ghcr.io/${GITHUB_REPOSITORY}" - - name: Change to github-actions[bot] - run: | - git config user.name github-actions[bot] - git config user.email 41898282+github-actions[bot]@users.noreply.github.com - - uses: google-github-actions/release-please-action@v3 + - uses: google-github-actions/release-please-action@v4 with: - path: charts/${{ needs.getChangedChart.outputs.chart }} - package-name: ${{ needs.getChangedChart.outputs.chart }} - command: github-release - changelog-types: '[{"type":"feat","section":"Features"},{"type":"fix","section":"Bug Fixes"},{"type":"chore","section":"Miscellaneous Chores"}]' - release-type: helm + skip-github-pull-request: true token: ${{ secrets.ACTIONS_BOT_TOKEN }} + config-file: .github/release-please/config.json + manifest-file: .github/release-please/manifest.json