Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Cicd #1480

Merged
merged 4 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Patch Release Branch Workflow
on:
pull_request:
types: [closed]
branches:
- 'v?[0-9]+.[0-9]+'
jobs:
call-common-workflow:
uses: dominant-strategies/quai-cicd/.github/workflows/deploy-sandbox-common.yml@main
with:
needs_build: true
build_command: "[ -f network.env.dist ] && mv network.env.dist network.env; make go-quai"
needs_docker: false
include_chart: false
cloud_deploy: false
skip_deploy: true
update_version: false
secrets:
GH_PAT: ${{ secrets.GH_PAT }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY2 }}
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
136 changes: 0 additions & 136 deletions .github/workflows/build-deploy.yml

This file was deleted.

29 changes: 14 additions & 15 deletions .github/workflows/build-on-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,18 @@ on:
- synchronize
- reopened
jobs:
build:
runs-on: ubuntu-latest
call-common-workflow:
uses: dominant-strategies/quai-cicd/.github/workflows/deploy-dev-common.yml@main
with:
needs_build: true
build_command: "[ -f network.env.dist ] && mv network.env.dist network.env; make go-quai"
needs_docker: false
include_chart: false
cloud_deploy: false
skip_deploy: true
update_version: false
secrets:
GH_PAT: ${{ secrets.GH_PAT }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY2 }}
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}

steps:
- name: Checkout repository
uses: actions/checkout@v3

- uses: actions/setup-go@v4
with:
go-version: '1.20'

- name: create network.env from dist
run: mv network.env.dist network.env

- name: build
run: make go-quai
114 changes: 21 additions & 93 deletions .github/workflows/cut-minor-release.yml
Original file line number Diff line number Diff line change
@@ -1,96 +1,24 @@
name: Cut a new Minor Release Branch
on: workflow_dispatch
name: Cut Minor Release Workflow
on:
workflow_dispatch:
inputs:
branch:
description: 'Branch to use'
required: true
default: 'main'
jobs:
cutReleaseCandidate:
runs-on: ubuntu-latest
outputs:
branch: ${{ steps.set-branch.outputs.branch }}
steps:
- uses: actions/checkout@v3
with:
ref: ${{ inputs.branch }}
ssh-key: ${{ secrets.GH_PAT }}

# Import the GPG key for signing Git commits and tags
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
git_user_signingkey: true
git_tag_gpgsign: true
git_commit_gpgsign: true

- name: get Version
run: echo "VERSION=$(cat VERSION)" >> $GITHUB_ENV

- name: Update version environment variable
run: echo "VERSION=$(echo $VERSION | sed 's/pre/rc/g' | awk -F. '{print $1"."$2"."$3"."0}')" >> $GITHUB_ENV

- name: Update 'VERSION' file
run: echo "$VERSION" > VERSION

- name: Update Chart.yaml version
run: yq eval -P -i ".appVersion=\"${{ env.VERSION }}\"" ./helm/Chart.yaml

- name: Update values.yaml version
run: yq eval -P -i ".goQuai.image.version=\"${{ env.VERSION }}\"" ./helm/values.yaml

- name: Update version environment variable e.g. v0.1.0-pre.0 -> v0.1
run: echo "BRANCH=$(echo $VERSION | sed 's/\.[0-9]*-.*//g')" >> $GITHUB_ENV

- name: Store version in branch variable
id: set-branch
run: echo "::set-output name=branch::${{ env.BRANCH }}"

- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Rev'd 'VERSION' file to ${{ env.VERSION }}
branch: ${{ env.BRANCH }}
create_branch: true
commit_options: -S
commit_user_email: [email protected]
commit_user_name: ci-dominantstrategies


- uses: actions/checkout@v3
with:
ref: ${{ inputs.branch }}
ssh-key: ${{ secrets.GH_PAT }}

- name: get Version
run: echo "VERSION=$(cat VERSION)" >> $GITHUB_ENV

- name: Update version environment variable
run: echo "VERSION=$(echo $VERSION | sed "s/-.*//g" | awk -F. '{print $1"."$2+1"."0"-pre.0"}')" >> $GITHUB_ENV

- name: Update 'VERSION' file
run: echo "$VERSION" > VERSION

- name: Update Chart.yaml version
run: yq eval -P -i ".appVersion=\"${{ env.VERSION }}\"" ./helm/Chart.yaml

- name: Update values.yaml version
run: yq eval -P -i ".goQuai.image.version=\"${{ env.VERSION }}\"" ./helm/values.yaml

- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Cut ${{ env.BRANCH }} release branch and rev'd 'VERSION' file to ${{ env.VERSION }}
branch: main
commit_options: -S
commit_user_email: [email protected]
commit_user_name: ci-dominantstrategies
deployReleaseCandidate:
uses: ./.github/workflows/build-deploy.yml
call-common-workflow:
uses: dominant-strategies/quai-cicd/.github/workflows/cut-release-common.yml@main
with:
branch: main
needs_build: true
build_command: "[ -f network.env.dist ] && mv network.env.dist network.env; make go-quai"
needs_docker: false
include_chart: false
cloud_deploy: false
skip_deploy: true
update_version: true
secrets:
DOCKER: ${{ secrets.DOCKER }}
GH_PAT: ${{ secrets.GH_PAT }}
GKE_SA_KEY: ${{ secrets.GKE_SA_KEY }}
GKE_PROJECT: ${{ secrets.GKE_PROJECT }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
with:
env: quai-sandbox
awk : sed -e "s/pre/rc/g" | awk -F . '{print $1"."$2"."$3"."$4+1}'
rails: '[[ ! "$VERSION" =~ "pre" ]]'
branch: ${{ needs.cutReleaseCandidate.outputs.branch }}
needs: [cutReleaseCandidate]
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY2 }}
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
15 changes: 0 additions & 15 deletions .github/workflows/deploy-dev.yml

This file was deleted.

16 changes: 0 additions & 16 deletions .github/workflows/deploy-prod.yml

This file was deleted.

16 changes: 0 additions & 16 deletions .github/workflows/deploy-sandbox.yml

This file was deleted.

20 changes: 20 additions & 0 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Dev Workflow
on:
pull_request:
types: [closed]
branches: [ "main" ]
jobs:
call-common-workflow:
uses: dominant-strategies/quai-cicd/.github/workflows/deploy-dev-common.yml@main
with:
needs_build: true
build_command: "[ -f network.env.dist ] && mv network.env.dist network.env; make go-quai"
needs_docker: false
include_chart: false
cloud_deploy: false
skip_deploy: true
update_version: false
secrets:
GH_PAT: ${{ secrets.GH_PAT }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY2 }}
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
Loading
Loading