mirror of
https://github.com/jimeh/casecmp.git
synced 2026-02-19 10:26:40 +00:00
108 lines
3.0 KiB
YAML
108 lines
3.0 KiB
YAML
---
|
|
name: CI
|
|
on: [push]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: "go.mod"
|
|
- name: Install dependencies
|
|
run: go mod download
|
|
- name: Build binary
|
|
run: make
|
|
- name: Run and make request
|
|
run: |
|
|
./bin/casecmp -p 8080 &
|
|
curl --silent --retry 10 --retry-delay 1 --retry-connrefused \
|
|
http://localhost:8080/
|
|
|
|
helm-lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: azure/setup-helm@v4
|
|
- name: Lint chart
|
|
run: helm lint chart
|
|
- name: Template chart
|
|
run: helm template chart
|
|
|
|
release-please:
|
|
runs-on: ubuntu-latest
|
|
if: startsWith(github.ref, 'refs/heads/')
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
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: jimeh/release-please-manifest-action@v2
|
|
id: release
|
|
with:
|
|
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@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- run: git fetch --force --tags
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v2
|
|
- uses: docker/setup-buildx-action@v2
|
|
- name: Docker Login
|
|
uses: docker/login-action@v2
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: "go.mod"
|
|
- name: Run GoReleaser
|
|
uses: goreleaser/goreleaser-action@v6
|
|
with:
|
|
version: '~> v2'
|
|
args: release --clean
|
|
env:
|
|
REGISTRY: ghcr.io
|
|
IMAGE_NAME: ${{ github.repository }}
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
release-chart:
|
|
runs-on: ubuntu-latest
|
|
needs: [release, release-please]
|
|
if: needs.release-please.outputs.release_created
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- 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@v4
|
|
- name: Run chart-releaser
|
|
uses: helm/chart-releaser-action@v1
|
|
with:
|
|
charts_dir: chart
|
|
config: .cr.yaml
|
|
env:
|
|
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|