Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Commit

Permalink
Merge pull request #59 from flanksource/feat/deploy-with-versioned-image
Browse files Browse the repository at this point in the history
ci: add automated versioned releases
  • Loading branch information
moshloop authored Jul 14, 2021
2 parents 704bbee + 2c1651b commit 552eef7
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 20 deletions.
18 changes: 0 additions & 18 deletions .github/workflows/docker.yml

This file was deleted.

56 changes: 56 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Create Release
on:
push:
branches:
- main
- master

jobs:
semantic-release:
runs-on: ubuntu-latest
outputs:
release-version: ${{ steps.semantic.outputs.release-version }}
new-release-published: ${{ steps.semantic.outputs.new-release-published }}
steps:
- uses: actions/checkout@v2
- uses: codfish/semantic-release-action@v1
id: semantic
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

operator:
needs: semantic-release
runs-on: ubuntu-latest
env:
VERSION: v${{ needs.semantic-release.outputs.release-version }}
steps:
- uses: actions/checkout@v2
- name: Build operator
working-directory: ./config/default/
run: |
kustomize edit set image flanksource/template-operator:v${{ needs.semantic-release.outputs.release-version }}
kustomize build . > operator.yml
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./config/default/operator.yml
tag: v${{ needs.semantic-release.outputs.release-version }}
asset_name: operator.yml
overwrite: true

docker:
needs: semantic-release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@master
env:
VERSION: v${{ needs.semantic-release.outputs.release-version }}"
with:
name: flanksource/template-operator
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
snapshot: true
tags: "latest,v${{ needs.semantic-release.outputs.release-version }}"
9 changes: 9 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,12 @@ jobs:
env:
KUBERNETES_VERSION: ${{matrix.k8s}}
run: ./test/e2e.sh
- name: Export logs
if: always()
run: kind --name kind-kind export logs ./logs
- name: Upload logs
if: always()
uses: actions/upload-artifact@v2
with:
name: log
path: ./logs
21 changes: 21 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
plugins:
- - "@semantic-release/commit-analyzer"
- releaseRules:
- { type: doc, scope: README, release: patch }
- { type: fix, release: patch }
- { type: chore, release: patch }
- { type: refactor, release: patch }
- { type: feat, release: minor }
- { type: ci, release: false }
- { type: style, release: false }
parserOpts:
noteKeywords:
- MAJOR RELEASE
- "@semantic-release/release-notes-generator"
- - "@semantic-release/github"
- assets:
- path: ./config/default/operator.yml
name: operator.yml
branches:
- main
- master
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@



ifeq ($(VERSION),)
VERSION_TAG=$(shell git describe --abbrev=0 --tags --exact-match 2>/dev/null || echo dev)
else
VERSION_TAG=$(VERSION)
endif

# Image URL to use all building/pushing image targets
IMG ?= flanksource/template-operator:v1
IMG ?= flanksource/template-operator:${VERSION_TAG}
# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
CRD_OPTIONS ?= "crd:trivialVersions=false"

Expand Down
2 changes: 1 addition & 1 deletion test/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

export KARINA_VERSION=v0.49.0
export KARINA_VERSION=v0.50.1
export KARINA="./karina -c test/config.yaml"
export KUBECONFIG=~/.kube/config
export DOCKER_API_VERSION=1.39
Expand Down

0 comments on commit 552eef7

Please sign in to comment.