mirror of
https://github.com/jimeh/casecmp.git
synced 2026-02-19 02:16:40 +00:00
Currently the chart release seems to not work, but that's an issue for another day.
106 lines
3.0 KiB
YAML
106 lines
3.0 KiB
YAML
---
|
|
name: CI
|
|
on: [push]
|
|
|
|
jobs:
|
|
build:
|
|
name: build
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/setup-go@v4
|
|
with:
|
|
go-version: "1.20"
|
|
- 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@v3
|
|
- uses: azure/setup-helm@v3
|
|
with:
|
|
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
|
|
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
|
|
|
|
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
|
|
- 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@v4
|
|
with:
|
|
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 }}
|
|
|
|
release-chart:
|
|
runs-on: ubuntu-latest
|
|
needs: [release, release-please]
|
|
if: needs.release-please.outputs.release_created
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
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@v3
|
|
- 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 }}"
|