mirror of
https://github.com/jimeh/casecmp.git
synced 2026-02-19 02:16:40 +00:00
ci(release): improve release-please and release jobs
This commit is contained in:
40
.github/workflows/ci.yml
vendored
40
.github/workflows/ci.yml
vendored
@@ -8,7 +8,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-go@v3
|
- uses: actions/setup-go@v4
|
||||||
with:
|
with:
|
||||||
go-version: 1.19
|
go-version: 1.19
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
@@ -27,46 +27,54 @@ jobs:
|
|||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: azure/setup-helm@v3
|
- uses: azure/setup-helm@v3
|
||||||
with:
|
with:
|
||||||
token: "${{ secrets.GITHUB_TOKEN }}"
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Lint chart
|
- name: Lint chart
|
||||||
run: helm lint chart
|
run: helm lint chart
|
||||||
- name: Template chart
|
- name: Template chart
|
||||||
run: helm template chart
|
run: helm template chart
|
||||||
|
|
||||||
release-please:
|
release-please:
|
||||||
|
name: Release Please
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [build, helm-lint]
|
|
||||||
if: github.ref == 'refs/heads/main'
|
if: github.ref == 'refs/heads/main'
|
||||||
|
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) }}
|
||||||
steps:
|
steps:
|
||||||
- uses: google-github-actions/release-please-action@v3
|
- uses: google-github-actions/release-please-action@v3
|
||||||
id: release-please
|
id: release-please
|
||||||
with:
|
with:
|
||||||
command: manifest
|
command: manifest
|
||||||
- if: ${{ steps.release-please.outputs.release_created }}
|
|
||||||
uses: actions/checkout@v3
|
release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [build, helm-lint, release-please]
|
||||||
|
if: needs.release-please.outputs.release_created
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- if: ${{ steps.release-please.outputs.release_created }}
|
- run: git fetch --force --tags
|
||||||
name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v2
|
uses: docker/setup-qemu-action@v2
|
||||||
- if: ${{ steps.release-please.outputs.release_created }}
|
- uses: docker/setup-buildx-action@v2
|
||||||
uses: docker/setup-buildx-action@v2
|
- name: Docker Login
|
||||||
- if: ${{ steps.release-please.outputs.release_created }}
|
|
||||||
name: Docker Login
|
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.repository_owner }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- if: ${{ steps.release-please.outputs.release_created }}
|
- uses: actions/setup-go@v4
|
||||||
uses: actions/setup-go@v3
|
|
||||||
with:
|
with:
|
||||||
go-version: 1.19
|
go-version: 1.19
|
||||||
- if: ${{ steps.release-please.outputs.release_created }}
|
- name: Run GoReleaser
|
||||||
name: Run GoReleaser
|
|
||||||
uses: goreleaser/goreleaser-action@v2
|
uses: goreleaser/goreleaser-action@v2
|
||||||
with:
|
with:
|
||||||
version: latest
|
version: latest
|
||||||
args: release --rm-dist
|
args: release --rm-dist
|
||||||
env:
|
env:
|
||||||
|
REGISTRY: ghcr.io
|
||||||
|
IMAGE: ${{ github.repository }}
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
@@ -47,8 +47,8 @@ changelog:
|
|||||||
|
|
||||||
dockers:
|
dockers:
|
||||||
- image_templates:
|
- image_templates:
|
||||||
- "ghcr.io/jimeh/casecmp:{{ .Version }}-amd64"
|
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}:{{ .Version }}-amd64"
|
||||||
- "ghcr.io/jimeh/casecmp:latest-amd64"
|
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}:latest-amd64"
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
use: buildx
|
use: buildx
|
||||||
goos: linux
|
goos: linux
|
||||||
@@ -56,8 +56,8 @@ dockers:
|
|||||||
build_flag_templates:
|
build_flag_templates:
|
||||||
- "--platform=linux/amd64"
|
- "--platform=linux/amd64"
|
||||||
- image_templates:
|
- image_templates:
|
||||||
- "ghcr.io/jimeh/casecmp:{{ .Version }}-386"
|
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}:{{ .Version }}-386"
|
||||||
- "ghcr.io/jimeh/casecmp:latest-386"
|
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}:latest-386"
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
use: buildx
|
use: buildx
|
||||||
goos: linux
|
goos: linux
|
||||||
@@ -65,8 +65,8 @@ dockers:
|
|||||||
build_flag_templates:
|
build_flag_templates:
|
||||||
- "--platform=linux/386"
|
- "--platform=linux/386"
|
||||||
- image_templates:
|
- image_templates:
|
||||||
- "ghcr.io/jimeh/casecmp:{{ .Version }}-arm64"
|
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}:{{ .Version }}-arm64"
|
||||||
- "ghcr.io/jimeh/casecmp:latest-arm64"
|
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}:latest-arm64"
|
||||||
use: buildx
|
use: buildx
|
||||||
goos: linux
|
goos: linux
|
||||||
goarch: arm64
|
goarch: arm64
|
||||||
@@ -74,8 +74,8 @@ dockers:
|
|||||||
build_flag_templates:
|
build_flag_templates:
|
||||||
- "--platform=linux/arm64"
|
- "--platform=linux/arm64"
|
||||||
- image_templates:
|
- image_templates:
|
||||||
- "ghcr.io/jimeh/casecmp:{{ .Version }}-armv6"
|
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}:{{ .Version }}-armv6"
|
||||||
- "ghcr.io/jimeh/casecmp:latest-armv6"
|
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}:latest-armv6"
|
||||||
use: buildx
|
use: buildx
|
||||||
goos: linux
|
goos: linux
|
||||||
goarch: arm
|
goarch: arm
|
||||||
@@ -84,8 +84,8 @@ dockers:
|
|||||||
build_flag_templates:
|
build_flag_templates:
|
||||||
- "--platform=linux/arm/v6"
|
- "--platform=linux/arm/v6"
|
||||||
- image_templates:
|
- image_templates:
|
||||||
- "ghcr.io/jimeh/casecmp:{{ .Version }}-armv7"
|
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}:{{ .Version }}-armv7"
|
||||||
- "ghcr.io/jimeh/casecmp:latest-armv7"
|
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}:latest-armv7"
|
||||||
use: buildx
|
use: buildx
|
||||||
goos: linux
|
goos: linux
|
||||||
goarch: arm
|
goarch: arm
|
||||||
@@ -95,17 +95,17 @@ dockers:
|
|||||||
- "--platform=linux/arm/v7"
|
- "--platform=linux/arm/v7"
|
||||||
|
|
||||||
docker_manifests:
|
docker_manifests:
|
||||||
- name_template: ghcr.io/jimeh/casecmp:{{ .Version }}
|
- name_template: "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}:{{ .Version }}"
|
||||||
image_templates:
|
image_templates:
|
||||||
- ghcr.io/jimeh/casecmp:{{ .Version }}-amd64
|
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}:{{ .Version }}-amd64"
|
||||||
- ghcr.io/jimeh/casecmp:{{ .Version }}-386
|
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}:{{ .Version }}-386"
|
||||||
- ghcr.io/jimeh/casecmp:{{ .Version }}-arm64
|
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}:{{ .Version }}-arm64"
|
||||||
- ghcr.io/jimeh/casecmp:{{ .Version }}-armv6
|
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}:{{ .Version }}-armv6"
|
||||||
- ghcr.io/jimeh/casecmp:{{ .Version }}-armv7
|
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}:{{ .Version }}-armv7"
|
||||||
- name_template: ghcr.io/jimeh/casecmp:latest
|
- name_template: "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}:latest"
|
||||||
image_templates:
|
image_templates:
|
||||||
- ghcr.io/jimeh/casecmp:latest-amd64
|
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}:latest-amd64"
|
||||||
- ghcr.io/jimeh/casecmp:latest-386
|
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}:latest-386"
|
||||||
- ghcr.io/jimeh/casecmp:latest-arm64
|
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}:latest-arm64"
|
||||||
- ghcr.io/jimeh/casecmp:latest-armv6
|
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}:latest-armv6"
|
||||||
- ghcr.io/jimeh/casecmp:latest-armv7
|
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}:latest-armv7"
|
||||||
|
|||||||
Reference in New Issue
Block a user