2020-12-16 01:16:53 +05:30
|
|
|
name: releaser
|
2020-08-11 05:46:13 +05:30
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
2020-11-25 15:50:56 -08:00
|
|
|
- 'v*'
|
2020-08-11 05:46:13 +05:30
|
|
|
jobs:
|
2021-02-23 04:18:11 +05:30
|
|
|
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:
|
2020-08-11 05:46:13 +05:30
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2020-11-25 15:50:56 -08:00
|
|
|
- name: Checkout
|
2020-08-11 05:46:13 +05:30
|
|
|
uses: actions/checkout@v2
|
2020-12-16 01:16:53 +05:30
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Set up Go
|
|
|
|
uses: actions/setup-go@v2
|
|
|
|
with:
|
|
|
|
go-version: 1.14
|
2020-11-25 15:50:56 -08:00
|
|
|
|
2020-12-16 01:16:53 +05:30
|
|
|
- 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-
|
2020-11-25 15:50:56 -08:00
|
|
|
|
|
|
|
- name: Set up Go
|
2020-08-11 05:46:13 +05:30
|
|
|
uses: actions/setup-go@v2
|
|
|
|
with:
|
|
|
|
go-version: 1.14
|
|
|
|
- uses: creekorful/goreportcard-action@v1.0
|
2020-08-11 22:02:51 +05:30
|
|
|
|
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
|
2020-08-11 22:02:51 +05:30
|
|
|
|
2021-02-19 07:39:01 +05:30
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
id: buildx
|
|
|
|
with:
|
|
|
|
install: true
|
|
|
|
|
2020-08-11 22:02:51 +05:30
|
|
|
- name : docker images publish
|
|
|
|
run: |
|
2021-02-23 04:18:11 +05:30
|
|
|
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-08-11 22:02:51 +05:30
|
|
|
|
2020-11-24 14:26:19 -08:00
|
|
|
- name: Run GoReleaser
|
2020-08-11 05:46:13 +05:30
|
|
|
uses: goreleaser/goreleaser-action@v2
|
|
|
|
with:
|
|
|
|
version: latest
|
2021-01-08 18:47:28 -08:00
|
|
|
args: release --rm-dist --debug
|
2020-08-11 05:46:13 +05:30
|
|
|
env:
|
2020-11-24 13:38:43 -08:00
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2020-08-11 05:46:13 +05:30
|
|
|
|
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 }}"
|
2020-12-16 01:16:53 +05:30
|
|
|
|
2021-02-23 04:18:11 +05:30
|
|
|
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
|