13 Commits

9 changed files with 84 additions and 49 deletions

2
.cr.yaml Normal file
View File

@@ -0,0 +1,2 @@
---
release-name-template: "v{{ .Version }}"

View File

@@ -8,9 +8,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
- uses: actions/setup-go@v4
with:
go-version: 1.19
go-version: "1.20"
- name: Install dependencies
run: go mod download
- name: Build binary
@@ -27,46 +27,69 @@ jobs:
- uses: actions/checkout@v3
- uses: azure/setup-helm@v3
with:
token: "${{ secrets.GITHUB_TOKEN }}"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Lint chart
run: helm lint chart
- name: Template chart
run: helm template chart
release-please:
name: Release Please
runs-on: ubuntu-latest
needs: [build, helm-lint]
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:
- uses: google-github-actions/release-please-action@v3
id: release-please
with:
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:
fetch-depth: 0
- if: ${{ steps.release-please.outputs.release_created }}
name: Set up QEMU
- run: git fetch --force --tags
- name: Configure Git
run: |
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: Set up QEMU
uses: docker/setup-qemu-action@v2
- if: ${{ steps.release-please.outputs.release_created }}
uses: docker/setup-buildx-action@v2
- if: ${{ steps.release-please.outputs.release_created }}
name: Docker Login
- uses: docker/setup-buildx-action@v2
- name: Docker Login
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- if: ${{ steps.release-please.outputs.release_created }}
uses: actions/setup-go@v3
- uses: actions/setup-go@v4
with:
go-version: 1.19
- if: ${{ steps.release-please.outputs.release_created }}
name: Run GoReleaser
go-version: "1.20"
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Package chart
run: helm package ./chart -d .cr-release-packages
- name: Run chart-releaser
uses: helm/chart-releaser-action@v1
with:
config: .cr.yaml
skip_packaging: true
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

View File

@@ -47,8 +47,8 @@ changelog:
dockers:
- image_templates:
- "ghcr.io/jimeh/casecmp:{{ .Version }}-amd64"
- "ghcr.io/jimeh/casecmp:latest-amd64"
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}:{{ .Version }}-amd64"
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}:latest-amd64"
dockerfile: Dockerfile
use: buildx
goos: linux
@@ -56,8 +56,8 @@ dockers:
build_flag_templates:
- "--platform=linux/amd64"
- image_templates:
- "ghcr.io/jimeh/casecmp:{{ .Version }}-386"
- "ghcr.io/jimeh/casecmp:latest-386"
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}:{{ .Version }}-386"
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}:latest-386"
dockerfile: Dockerfile
use: buildx
goos: linux
@@ -65,8 +65,8 @@ dockers:
build_flag_templates:
- "--platform=linux/386"
- image_templates:
- "ghcr.io/jimeh/casecmp:{{ .Version }}-arm64"
- "ghcr.io/jimeh/casecmp:latest-arm64"
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}:{{ .Version }}-arm64"
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}:latest-arm64"
use: buildx
goos: linux
goarch: arm64
@@ -74,8 +74,8 @@ dockers:
build_flag_templates:
- "--platform=linux/arm64"
- image_templates:
- "ghcr.io/jimeh/casecmp:{{ .Version }}-armv6"
- "ghcr.io/jimeh/casecmp:latest-armv6"
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}:{{ .Version }}-armv6"
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}:latest-armv6"
use: buildx
goos: linux
goarch: arm
@@ -84,8 +84,8 @@ dockers:
build_flag_templates:
- "--platform=linux/arm/v6"
- image_templates:
- "ghcr.io/jimeh/casecmp:{{ .Version }}-armv7"
- "ghcr.io/jimeh/casecmp:latest-armv7"
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}:{{ .Version }}-armv7"
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}:latest-armv7"
use: buildx
goos: linux
goarch: arm
@@ -95,17 +95,17 @@ dockers:
- "--platform=linux/arm/v7"
docker_manifests:
- name_template: ghcr.io/jimeh/casecmp:{{ .Version }}
- name_template: "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}:{{ .Version }}"
image_templates:
- ghcr.io/jimeh/casecmp:{{ .Version }}-amd64
- ghcr.io/jimeh/casecmp:{{ .Version }}-386
- ghcr.io/jimeh/casecmp:{{ .Version }}-arm64
- ghcr.io/jimeh/casecmp:{{ .Version }}-armv6
- ghcr.io/jimeh/casecmp:{{ .Version }}-armv7
- name_template: ghcr.io/jimeh/casecmp:latest
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}:{{ .Version }}-amd64"
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}:{{ .Version }}-386"
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}:{{ .Version }}-arm64"
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}:{{ .Version }}-armv6"
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}:{{ .Version }}-armv7"
- name_template: "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}:latest"
image_templates:
- ghcr.io/jimeh/casecmp:latest-amd64
- ghcr.io/jimeh/casecmp:latest-386
- ghcr.io/jimeh/casecmp:latest-arm64
- ghcr.io/jimeh/casecmp:latest-armv6
- ghcr.io/jimeh/casecmp:latest-armv7
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}:latest-amd64"
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}:latest-386"
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}:latest-arm64"
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}:latest-armv6"
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}:latest-armv7"

View File

@@ -1,3 +1,3 @@
{
".": "2.2.0"
}
".": "2.3.0"
}

View File

@@ -1,5 +1,12 @@
# Changelog
## [2.3.0](https://github.com/jimeh/casecmp/compare/v2.2.0...v2.3.0) (2023-04-26)
### Features
* **version:** add Go version to version output ([5500933](https://github.com/jimeh/casecmp/commit/55009336891b6c281542cf85498abb04816879d3))
## [2.2.0](https://github.com/jimeh/casecmp/compare/v2.1.0...v2.2.0) (2023-03-10)

View File

@@ -15,10 +15,10 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 2.2.0 # x-release-please-version
version: 2.3.0 # x-release-please-version
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: 2.2.0 # x-release-please-version
appVersion: 2.3.0 # x-release-please-version

2
go.mod
View File

@@ -1,3 +1,3 @@
module github.com/jimeh/casecmp
go 1.19
go 1.20

View File

@@ -9,6 +9,7 @@ import (
"log"
"net/http"
"os"
"runtime"
"strconv"
"strings"
"text/template"
@@ -154,6 +155,8 @@ func printVersion() {
buffer.WriteString(fmt.Sprintf(" (%s)", commit))
}
buffer.WriteString(fmt.Sprintf(", built with %s", runtime.Version()))
fmt.Println(buffer.String())
}

View File

@@ -1,10 +1,10 @@
{
"release-type": "go",
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": true,
"packages": {
".": {
"release-type": "go",
"changelog-path": "CHANGELOG.md",
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": true,
"draft": false,
"prerelease": false,
"extra-files": [
@@ -13,4 +13,4 @@
}
},
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
}
}