Skip to content

Commit

Permalink
[monorepo] Move flytectl gh workflows to monorepo (#5354)
Browse files Browse the repository at this point in the history
* [flytectl] Add goreleaser dry-run job

Signed-off-by: Eduardo Apolinario <[email protected]>

* Use actions/checkout@v4

Signed-off-by: Eduardo Apolinario <[email protected]>

* Add sandbox test and flytectl-release gh workflow

Signed-off-by: Eduardo Apolinario <[email protected]>

* Skip flyteidl release if releasing flytectl

Signed-off-by: Eduardo Apolinario <[email protected]>

* Add github token to flytectl release gh workflow

Signed-off-by: Eduardo Apolinario <[email protected]>

---------

Signed-off-by: Eduardo Apolinario <[email protected]>
Co-authored-by: Eduardo Apolinario <[email protected]>
  • Loading branch information
eapolinario and eapolinario authored May 15, 2024
1 parent 7b82397 commit 4dd5f3c
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,59 @@ jobs:
secrets:
FLYTE_BOT_PAT: ${{ secrets.FLYTE_BOT_PAT }}
FLYTE_BOT_USERNAME: ${{ secrets.FLYTE_BOT_USERNAME }}

dry_run_goreleaser:
name: Dry Run Goreleaser
runs-on: ubuntu-latest
needs:
- unpack-envvars
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: "0"
- uses: actions/setup-go@v4
with:
go-version: ${{ needs.unpack-envvars.outputs.go-version }}
- name: Run GoReleaser dry run
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser-pro
version: latest
args: --snapshot --skip-publish --rm-dist -f flytectl/.goreleaser.yml
env:
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}

sandbox:
name: Test Getting started
runs-on: ubuntu-latest
defaults:
run:
working-directory: flytectl
needs:
- unpack-envvars
steps:
- uses: insightsengineering/disk-space-reclaimer@v1
- name: Checkout
uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ needs.unpack-envvars.outputs.go-version }}
- name: Build Flytectl binary
run: make compile
- name: Create a sandbox cluster
run: |
bin/flytectl demo start
- name: Setup flytectl config
run: bin/flytectl config init
- name: Register cookbook
run: bin/flytectl register examples -d development -p flytesnacks
- name: Teardown Sandbox cluster
run: bin/flytectl demo teardown
27 changes: 27 additions & 0 deletions .github/workflows/flytectl-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Flytectl release

on:
push:
tags:
- flytectl/v*.*.*

jobs:
release:
name: Goreleaser
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: "0"
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.21"
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser-pro
args: release --rm-dist -f flytectl/.goreleaser.yml
env:
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
GITHUB_TOKEN: ${{ secrets.FLYTE_BOT_PAT }}
2 changes: 2 additions & 0 deletions .github/workflows/flyteidl-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:

jobs:
deploy-to-pypi:
if: "!startsWith(github.event.release.tag_name, 'flytectl/')"
runs-on: ubuntu-latest
defaults:
run:
Expand All @@ -28,6 +29,7 @@ jobs:
python -m build
twine upload dist/*
deploy-to-npm:
if: "!startsWith(github.event.release.tag_name, 'flytectl/')"
runs-on: ubuntu-latest
defaults:
run:
Expand Down
6 changes: 6 additions & 0 deletions flytectl/.goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
project_name: flytectl

monorepo:
tag_prefix: flytectl/
dir: flytectl

before:
hooks:
- go mod download
Expand Down

0 comments on commit 4dd5f3c

Please sign in to comment.