Skip to content

Cut Minor Release Workflow #17

Cut Minor Release Workflow

Cut Minor Release Workflow #17

name: Cut a new Minor Release Branch
on: workflow_dispatch
jobs:
cutReleaseCandidate:
runs-on: ubuntu-latest
outputs:
branch: ${{ steps.set-branch.outputs.branch }}
steps:
- uses: actions/checkout@v3
# 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 }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
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: ci@dominantstrategies.io
commit_user_name: ci-dominantstrategies
- uses: actions/checkout@v3
- 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
- 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: ci@dominantstrategies.io
commit_user_name: ci-dominantstrategies
deployReleaseCandidate:
uses: ./.github/workflows/build-deploy.yml

Check failure on line 76 in .github/workflows/cut-minor-release.yml

View workflow run for this annotation

GitHub Actions / Cut a new Minor Release Branch

Invalid workflow file

The workflow is not valid. .github/workflows/cut-minor-release.yml (Line: 76, Col: 11): Secret GH_PAT is required, but not provided while calling.

Check failure on line 76 in .github/workflows/cut-minor-release.yml

View workflow run for this annotation

GitHub Actions / Cut a new Minor Release Branch

Invalid workflow file

error parsing called workflow ".github/workflows/cut-minor-release.yml" -> "./.github/workflows/build-deploy.yml" : workflow was not found. See https://docs.github.com/actions/learn-github-actions/reusing-workflows#access-to-reusable-workflows for more information.

Check failure on line 76 in .github/workflows/cut-minor-release.yml

View workflow run for this annotation

GitHub Actions / Cut a new Minor Release Branch

Invalid workflow file

error parsing called workflow ".github/workflows/cut-minor-release.yml" -> "./.github/workflows/build-deploy.yml" : workflow was not found. See https://docs.github.com/actions/learn-github-actions/reusing-workflows#access-to-reusable-workflows for more information.

Check failure on line 76 in .github/workflows/cut-minor-release.yml

View workflow run for this annotation

GitHub Actions / Cut a new Minor Release Branch

Invalid workflow file

error parsing called workflow ".github/workflows/cut-minor-release.yml" -> "./.github/workflows/build-deploy.yml" : workflow was not found. See https://docs.github.com/actions/learn-github-actions/reusing-workflows#access-to-reusable-workflows for more information.
secrets:
DOCKER: ${{ secrets.DOCKER }}
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]