1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-06 16:06:56 +00:00
kyverno/.github/workflows/release.yaml

204 lines
5.1 KiB
YAML
Raw Normal View History

name: releaser
on:
push:
tags:
- 'v*'
jobs:
release-init-kyverno:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.14
- name: Cache Go modules
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.14
- uses: creekorful/goreportcard-action@v1.0
- name: login to GitHub Container Registry
run: echo ${{ secrets.CR_PAT }} | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
id: buildx
with:
install: true
- name : docker images publish
run: |
make docker-publish-initContainer
release-kyverno:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.14
- name: Cache Go modules
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.14
- uses: creekorful/goreportcard-action@v1.0
- name: login to GitHub Container Registry
run: echo ${{ secrets.CR_PAT }} | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
id: buildx
with:
install: true
- name : docker images publish
run: |
make docker-publish-kyverno
release-kyverno-cli:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.14
- name: Cache Go modules
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.14
- uses: creekorful/goreportcard-action@v1.0
2020-11-24 12:56:35 -08:00
- name: login to GitHub Container Registry
run: echo ${{ secrets.CR_PAT }} | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
id: buildx
with:
install: true
- name : docker images publish
run: |
make docker-publish-cli
create-release:
runs-on: ubuntu-latest
needs:
- release-init-kyverno
- release-kyverno
- release-kyverno-cli
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.14
- name: Cache Go modules
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.14
- uses: creekorful/goreportcard-action@v1.0
- name: login to GitHub Container Registry
run: echo ${{ secrets.CR_PAT }} | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin
2020-11-24 14:26:19 -08:00
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
2021-01-08 18:47:28 -08:00
args: release --rm-dist --debug
env:
2020-11-24 13:38:43 -08:00
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2020-11-24 14:52:40 -08:00
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
2020-11-24 14:44:11 -08:00
2020-11-24 14:52:40 -08:00
- name: Install Helm
uses: azure/setup-helm@v1
2020-11-24 14:44:11 -08:00
with:
2020-11-24 14:52:40 -08:00
version: v3.4.0
2020-11-24 14:44:11 -08:00
2020-11-24 14:52:40 -08:00
- name: Run chart-releaser
uses: helm/chart-releaser-action@v1.1.0
env:
2020-11-24 15:00:18 -08:00
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
release-cli-via-krew:
runs-on: ubuntu-latest
needs: create-release
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Unshallow
run: git fetch --prune --unshallow
- name: Check Tag
id: check-tag
run: |
if [[ ${{ github.event.ref }} =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo ::set-output name=match::true
fi
- name: Update new version in krew-index
if: steps.check-tag.outputs.match == 'true'
uses: rajatjindal/krew-release-bot@v0.0.38