diff --git a/.release-please-manifest.json b/.github/.release-please-manifest.json similarity index 100% rename from .release-please-manifest.json rename to .github/.release-please-manifest.json diff --git a/release-please-config.json b/.github/release-please-config.json similarity index 93% rename from release-please-config.json rename to .github/release-please-config.json index 01f3093..b16476d 100644 --- a/release-please-config.json +++ b/.github/release-please-config.json @@ -6,6 +6,7 @@ "bump-minor-pre-major": true, "bump-patch-for-minor-pre-major": true, "draft": false, + "always-update": true, "prerelease": false, "extra-files": [ "chart/Chart.yaml" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9e2e3eb..71baed6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,10 +7,10 @@ jobs: name: build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version-file: "go.mod" - name: Install dependencies run: go mod download - name: Build binary @@ -24,10 +24,8 @@ jobs: helm-lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: azure/setup-helm@v3 - with: - token: ${{ secrets.GITHUB_TOKEN }} + - uses: actions/checkout@v4 + - uses: azure/setup-helm@v4 - name: Lint chart run: helm lint chart - name: Template chart @@ -36,24 +34,30 @@ jobs: release-please: name: Release Please runs-on: ubuntu-latest - if: github.ref == 'refs/heads/main' + if: startsWith(github.ref, 'refs/heads/') + permissions: + contents: write + pull-requests: write outputs: - release_created: ${{ steps.release-please.outputs.release_created }} - tag_name: ${{ steps.release-please.outputs.tag_name }} # e.g. v1.0.0 - version: ${{ steps.release-please.outputs.version }} # e.g. 1.0.0 - all: ${{ toJSON(steps.release-please.outputs) }} + release_created: ${{ steps.release.outputs.release_created }} + tag_name: ${{ steps.release.outputs.tag_name }} # e.g. v1.0.0 + version: ${{ steps.release.outputs.version }} # e.g. 1.0.0 steps: - - uses: google-github-actions/release-please-action@v3 - id: release-please + - uses: jimeh/release-please-manifest-action@v2 + id: release with: - command: manifest + target-branch-pattern: '^(main|master|release-[0-9]+(\.[0-9]+)?\.x)$' + app-id: ${{ secrets.RELEASE_BOT_APP_ID }} + private-key: ${{ secrets.RELEASE_BOT_PRIVATE_KEY }} release: runs-on: ubuntu-latest needs: [build, helm-lint, release-please] if: needs.release-please.outputs.release_created + permissions: + contents: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - run: git fetch --force --tags @@ -66,14 +70,14 @@ jobs: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version-file: "go.mod" - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v2 + uses: goreleaser/goreleaser-action@v6 with: - version: latest - args: release --rm-dist + version: '~> v2' + args: release --clean env: REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} @@ -83,8 +87,10 @@ jobs: runs-on: ubuntu-latest needs: [release, release-please] if: needs.release-please.outputs.release_created + permissions: + contents: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - run: git fetch --force --tags @@ -93,13 +99,11 @@ jobs: git config user.name "${{ github.actor }}" git config user.email "${{ github.actor }}@users.noreply.github.com" - name: Install Helm - uses: azure/setup-helm@v3 - - name: Package chart - run: helm package ./chart -d .cr-release-packages + uses: azure/setup-helm@v4 - name: Run chart-releaser uses: helm/chart-releaser-action@v1 with: + charts_dir: chart config: .cr.yaml - skip_packaging: true env: CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.goreleaser.yml b/.goreleaser.yml index dbb1a42..6a5061e 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,3 +1,4 @@ +version: 2 before: hooks: - go mod tidy @@ -27,23 +28,21 @@ universal_binaries: - replace: false archives: - - format: tar.gz + - formats: ["tar.gz"] name_template: |- - {{ .ProjectName }}-{{ .Version }}_{{ .Os }}_{{ if eq .Arch "all" }}universal{{ else }}{{ .Arch }}{{ end }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }} + {{ .ProjectName }}-{{ .Version }}_{{ if eq .Os "darwin" }}macos{{ else }}{{ .Os }}{{ end }}_{{ if eq .Arch "all" }}universal{{ else }}{{ .Arch }}{{ end }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }} wrap_in_directory: true format_overrides: - goos: windows - format: zip - replacements: - darwin: macos + formats: ["zip"] checksum: name_template: "checksums.txt" snapshot: - name_template: "{{ .Tag }}-next" + version_template: "{{ .Tag }}-next" changelog: - skip: true + disable: true dockers: - image_templates: