ci(deps): update workflow actions and config (#18)

This commit is contained in:
2025-03-16 00:43:20 +00:00
committed by GitHub
parent de40d5459f
commit 90728a4807
4 changed files with 37 additions and 33 deletions

View File

@@ -6,6 +6,7 @@
"bump-minor-pre-major": true, "bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": true, "bump-patch-for-minor-pre-major": true,
"draft": false, "draft": false,
"always-update": true,
"prerelease": false, "prerelease": false,
"extra-files": [ "extra-files": [
"chart/Chart.yaml" "chart/Chart.yaml"

View File

@@ -7,10 +7,10 @@ jobs:
name: build name: build
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: actions/setup-go@v4 - uses: actions/setup-go@v5
with: with:
go-version: "1.20" go-version-file: "go.mod"
- name: Install dependencies - name: Install dependencies
run: go mod download run: go mod download
- name: Build binary - name: Build binary
@@ -24,10 +24,8 @@ jobs:
helm-lint: helm-lint:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: azure/setup-helm@v3 - uses: azure/setup-helm@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Lint chart - name: Lint chart
run: helm lint chart run: helm lint chart
- name: Template chart - name: Template chart
@@ -36,24 +34,30 @@ jobs:
release-please: release-please:
name: Release Please name: Release Please
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' if: startsWith(github.ref, 'refs/heads/')
permissions:
contents: write
pull-requests: write
outputs: outputs:
release_created: ${{ steps.release-please.outputs.release_created }} release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release-please.outputs.tag_name }} # e.g. v1.0.0 tag_name: ${{ steps.release.outputs.tag_name }} # e.g. v1.0.0
version: ${{ steps.release-please.outputs.version }} # e.g. 1.0.0 version: ${{ steps.release.outputs.version }} # e.g. 1.0.0
all: ${{ toJSON(steps.release-please.outputs) }}
steps: steps:
- uses: google-github-actions/release-please-action@v3 - uses: jimeh/release-please-manifest-action@v2
id: release-please id: release
with: 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: release:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [build, helm-lint, release-please] needs: [build, helm-lint, release-please]
if: needs.release-please.outputs.release_created if: needs.release-please.outputs.release_created
permissions:
contents: write
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
- run: git fetch --force --tags - run: git fetch --force --tags
@@ -66,14 +70,14 @@ jobs:
registry: ghcr.io registry: ghcr.io
username: ${{ github.actor }} username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }} password: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-go@v4 - uses: actions/setup-go@v5
with: with:
go-version: "1.20" go-version-file: "go.mod"
- name: Run GoReleaser - name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2 uses: goreleaser/goreleaser-action@v6
with: with:
version: latest version: '~> v2'
args: release --rm-dist args: release --clean
env: env:
REGISTRY: ghcr.io REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }} IMAGE_NAME: ${{ github.repository }}
@@ -83,8 +87,10 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [release, release-please] needs: [release, release-please]
if: needs.release-please.outputs.release_created if: needs.release-please.outputs.release_created
permissions:
contents: write
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
- run: git fetch --force --tags - run: git fetch --force --tags
@@ -93,13 +99,11 @@ jobs:
git config user.name "${{ github.actor }}" git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor }}@users.noreply.github.com" git config user.email "${{ github.actor }}@users.noreply.github.com"
- name: Install Helm - name: Install Helm
uses: azure/setup-helm@v3 uses: azure/setup-helm@v4
- name: Package chart
run: helm package ./chart -d .cr-release-packages
- name: Run chart-releaser - name: Run chart-releaser
uses: helm/chart-releaser-action@v1 uses: helm/chart-releaser-action@v1
with: with:
charts_dir: chart
config: .cr.yaml config: .cr.yaml
skip_packaging: true
env: env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

View File

@@ -1,3 +1,4 @@
version: 2
before: before:
hooks: hooks:
- go mod tidy - go mod tidy
@@ -27,23 +28,21 @@ universal_binaries:
- replace: false - replace: false
archives: archives:
- format: tar.gz - formats: ["tar.gz"]
name_template: |- 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 wrap_in_directory: true
format_overrides: format_overrides:
- goos: windows - goos: windows
format: zip formats: ["zip"]
replacements:
darwin: macos
checksum: checksum:
name_template: "checksums.txt" name_template: "checksums.txt"
snapshot: snapshot:
name_template: "{{ .Tag }}-next" version_template: "{{ .Tag }}-next"
changelog: changelog:
skip: true disable: true
dockers: dockers:
- image_templates: - image_templates: