feat: cloud-run compatibility (#3438)

* ci: don't run on tags anymore

* ci: also test docker builds

* .releaserc.js entry and wf dispatch for prerel

* .releaserc.js entry and wf dispatch for prerel

* create prerelease

* create prereleases

* fix syntax

* fix: release

* test before tag

* temporarily disable tests

* fix: prerelease

* fix: add --rm-dist flag

* fix: push to zitadel-common

* fix: gcr login

* fix: release

* fix: ignore generated assets.md

* fix: don't use go-releaser before hooks

* build grpc client before testing

* fix: use docker buildkit

* debug

* debug

* fix: debug

* fix: debug

* fix: run action steps in $GOPATH

* fix: run action steps in $GOPATH

* fix: run action steps in $GOPATH

* fix: run action steps in $GOPATH

* fix: run action steps in $GOPATH

* fix: run action steps in $GOPATH

* fix: run action steps in $GOPATH

* fix: run action steps in $GOPATH

* fix: run action steps in $GOPATH

* fix: run action steps in $GOPATH

* unignore

* fix: unignore

* fix: unignore

* build base

* fix: ignore

* no mod proxy

* fix: test using goreleaser before hook

* fix: build without having a git tag

* fix: build without having a git tag

* fix: push to ghcr

* fix: login to ghcr

* fix: login to ghcr if releasing

* fix: permit to write packages

* fix: aesthetics

* fix: login using base64 encoded key

* fix: publish images with short sha and tag

* fix: read masterkey from file for start-from-init

* fix: release if workflow_dispatch or main

* ci: only test before tag

* fix: no workdir, login action for gcr

* fix: review

* fix: run on PR

* push amd64 images to gcr
This commit is contained in:
Elio Bischof
2022-04-12 16:44:49 +02:00
committed by GitHub
parent cea2567e22
commit 20bdd8e3a1
7 changed files with 57 additions and 302 deletions

View File

@@ -1,30 +1,28 @@
name: ZITADEL Release
on:
#pull_request:
pull_request:
push:
tags-ignore:
- "*"
workflow_dispatch:
permissions:
contents: write
packages: write
jobs:
Build:
runs-on: ubuntu-20.04
env:
DOCKER_BUILDKIT: 1
steps:
- name: Source checkout
uses: actions/checkout@v2
- name: Semantic Release
id: semantic
uses: cycjimmy/semantic-release-action@v2
with:
dry_run: true
semantic_version: 19.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
- name: Source checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
@@ -32,41 +30,54 @@ jobs:
with:
driver: docker
install: true
- name: Run GoReleaser Snapshot
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
uses: goreleaser/goreleaser-action@v2
- name: Test
run: docker build -f build/grpc/Dockerfile -t zitadel-base:local . && docker build -f build/zitadel/Dockerfile . -t zitadel-go-test --target go-codecov -o .artifacts/codecov
- name: Tag
id: semantic
uses: cycjimmy/semantic-release-action@v2
with:
distribution: goreleaser
version: v1.5.0
args: release --snapshot
dry_run: false
semantic_version: 19.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run GoReleaser Release on tag
if: ${{ startsWith(github.ref, 'refs/tags/') }}
uses: goreleaser/goreleaser-action@v2
- name: GitHub Container Registry Login
if: steps.semantic.outputs.new_release_published == 'true' && github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Google Artifact Registry Login
if: steps.semantic.outputs.new_release_published == 'true' && github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch'
uses: docker/login-action@v1
with:
registry: europe-docker.pkg.dev
username: _json_key_base64
password: ${{ secrets.GCR_JSON_KEY_BASE64 }}
- uses: goreleaser/goreleaser-action@v2
name: Publish ZITADEL
if: steps.semantic.outputs.new_release_published == 'true' && github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch'
with:
distribution: goreleaser
version: v1.5.0
args: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifact@v2
name: Upload goreleaser dist
with:
name: goreleaser-dist
path: .artifacts/goreleaser
- uses: actions/upload-artifact@v2
name: Upload gRPC clients
RELEASE_VERSION: ${{ steps.semantic.outputs.release-version }} # I think this line is not needed. Nevertheless, it's explicit
- name: Publish gRPC clients
uses: actions/upload-artifact@v2
if: steps.semantic.outputs.new_release_published == 'true' && github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch'
with:
name: grpc-clients
path: .artifacts/grpc
- uses: actions/upload-artifact@v2
name: Upload compiled console
- name: Publish console
uses: actions/upload-artifact@v2
if: steps.semantic.outputs.new_release_published == 'true' && github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch'
with:
name: console
path: .artifacts/console
- uses: codecov/codecov-action@v1
name: Upload go coverage
- name: Publish go coverage
uses: codecov/codecov-action@v1
with:
files: .artifacts/codecov/profile.cov
name: go-codecov