From 89ca2e7d0d176276cd7dfd77d97a2b2e3ae0725e Mon Sep 17 00:00:00 2001 From: Yuvraj <10830562+evalsocket@users.noreply.github.com> Date: Thu, 29 Apr 2021 00:34:48 +0530 Subject: [PATCH] Added goreleaser for publishing menifest (#927) * added goreleaser for publishing menifest Signed-off-by: yuvraj * Rename release file name Signed-off-by: yuvraj * Added script for artifacts Signed-off-by: yuvraj * More changes Signed-off-by: yuvraj * More changes Signed-off-by: yuvraj * fix typo Signed-off-by: yuvraj * minor changes Signed-off-by: yuvraj Signed-off-by: Haytham Abuelfutuh --- .github/workflows/publish-menifest.yml | 40 ++++++++++++++++++++++++++ .gitignore | 1 + .goreleaser.yml | 14 +++++++++ Makefile | 4 +++ script/prepare_artifacts.sh | 11 +++++++ 5 files changed, 70 insertions(+) create mode 100644 .github/workflows/publish-menifest.yml create mode 100644 .goreleaser.yml create mode 100644 script/prepare_artifacts.sh diff --git a/.github/workflows/publish-menifest.yml b/.github/workflows/publish-menifest.yml new file mode 100644 index 0000000000..834e3f51d6 --- /dev/null +++ b/.github/workflows/publish-menifest.yml @@ -0,0 +1,40 @@ +name: Create a flyte release +on: + workflow_dispatch: + inputs: + version: + description: 'version name. example v0.1.1' + required: true + +jobs: + goreleaser: + name: Goreleaser + runs-on: ubuntu-latest + outputs: + version: ${{ steps.bump-version.outputs.tag }} + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: "0" + - name: Bump version and push tag + id: bump-version + uses: anothrNick/github-tag-action@1.17.2 + env: + GITHUB_TOKEN: ${{ secrets.FLYTE_BOT_PAT }} + WITH_V: true + CUSTOM_TAG: ${{ github.event.inputs.version }} + RELEASE_BRANCHES: master + - uses: actions/checkout@v2 + with: + fetch-depth: "0" + ref: ${{ github.event.inputs.version }} + - name: build Release Menifest + run: | + make prepare_artifacts + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + with: + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.FLYTE_BOT_PAT }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 9be7cc094f..5abe39323f 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ docs/_sources/ docs/flytekit/flytekit.interfaces.html docs/searchindex.js docs/ +release/ __pycache__/ /helm/charts/ Chart.lock diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000000..a69fd22b81 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,14 @@ +project_name: flyte +builds: + - skip: true +release: + github: + owner: flyteorg + name: flyte + draft: false + prerelease: auto + discussion_category_name: General + name_template: "{{.ProjectName}}-v{{.Version}}" + disable: false + extra_files: + - glob: ./release/* \ No newline at end of file diff --git a/Makefile b/Makefile index f343018352..f88733e9e5 100644 --- a/Makefile +++ b/Makefile @@ -47,3 +47,7 @@ stats: @generate-dashboard -o deployment/stats/prometheus/flytepropeller-dashboard.json stats/flytepropeller_dashboard.py @generate-dashboard -o deployment/stats/prometheus/flyteadmin-dashboard.json stats/flyteadmin_dashboard.py @generate-dashboard -o deployment/stats/prometheus/flyteuser-dashboard.json stats/flyteuser_dashboard.py + +.PHONY: prepare_artifacts +prepare_artifacts: + bash script/prepare_artifacts.sh \ No newline at end of file diff --git a/script/prepare_artifacts.sh b/script/prepare_artifacts.sh new file mode 100644 index 0000000000..e2d60e7f8d --- /dev/null +++ b/script/prepare_artifacts.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +set -ex + +for file in ./deployment/**/flyte_generated.yaml; do + if [ -f "$file" ]; then + result=${file/#"./deployment/"} + result=${result/%"/flyte_generated.yaml"} + cp $file "./release/flyte_${result}_manifest.yaml" + fi +done