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
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-go@v3
|
||||
- uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: 1.19
|
||||
- name: Install dependencies
|
||||
@@ -27,46 +27,54 @@ 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: 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
|
||||
- name: Run GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v2
|
||||
with:
|
||||
version: latest
|
||||
args: release --rm-dist
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
IMAGE: ${{ github.repository }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
Reference in New Issue
Block a user