From f7a3ac67dfdbdcf1f9611a051acd2ae8427d537d Mon Sep 17 00:00:00 2001 From: Ivan Zubenko Date: Thu, 18 Jun 2020 16:54:37 +0300 Subject: [PATCH] add release github workflow (#42) --- .github/workflows/ci.yaml | 2 +- .github/workflows/release.yaml | 33 +++++++++++++++++++++++++++++++++ Makefile | 13 +++++++++++++ 3 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8ff92a54..afe3f599 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -33,7 +33,7 @@ jobs: - name: Install helm run: | sudo apt -y install socat - curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash -s -- -v v2.16.7 + make helm_install helm init --wait - name: Run integration tests run: make test_integration diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 00000000..71ed8eee --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,33 @@ +name: Release + +on: + release: + types: [published] + tags: + - v*.*.* + +jobs: + test: + name: Publish release + runs-on: ubuntu-latest + + env: + ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }} + ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} + + steps: + - name: Checkout commit + uses: actions/checkout@v2 + - name: Set env + run: echo ::set-env name=TAG::${GITHUB_REF#refs/tags/v} + - name: Push docker image + run: | + make docker_login + make docker_push + - name: Push helm packages + run: | + make helm_install + helm init --client-only + make helm_plugin_install + make helm_repo_add + make helm_push diff --git a/Makefile b/Makefile index 1f9f6f45..8563cccd 100644 --- a/Makefile +++ b/Makefile @@ -25,12 +25,21 @@ test_integration: docker_build: docker build -t $(IMAGE) . +docker_login: + @docker login $(DOCKER_REPO) \ + --username=$(ARTIFACTORY_USERNAME) \ + --password=$(ARTIFACTORY_PASSWORD) + docker_push: docker_build ifeq ($(TAG),latest) $(error Docker image tag is not specified) endif docker push $(IMAGE) +helm_install: + curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get \ + | bash -s -- -v v2.16.7 + helm_plugin_install: helm plugin install https://github.com/belitre/helm-push-artifactory-plugin @@ -41,6 +50,10 @@ endif ifeq ($(ARTIFACTORY_PASSWORD),) $(error Artifactory password is not specified) endif + @helm repo add neuro \ + https://neuro.jfrog.io/artifactory/helm-virtual-public \ + --username ${ARTIFACTORY_USERNAME} \ + --password ${ARTIFACTORY_PASSWORD} @helm repo add neuro-local-public \ https://neuro.jfrog.io/artifactory/helm-local-public \ --username ${ARTIFACTORY_USERNAME} \