zitadel/.github/workflows/zitadel.yml
Elio Bischof 20bdd8e3a1
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
2022-04-12 14:44:49 +00:00

84 lines
3.0 KiB
YAML

name: ZITADEL Release
on:
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: 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
uses: docker/setup-buildx-action@v1
with:
driver: docker
install: true
- 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:
dry_run: false
semantic_version: 19.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- 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 }}
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
- 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
- name: Publish go coverage
uses: codecov/codecov-action@v1
with:
files: .artifacts/codecov/profile.cov
name: go-codecov