Skip to content

Commit

Permalink
[DEV] Automated Workflows v1.8.1-dev1 Release
Browse files Browse the repository at this point in the history
[GITOPS] - Merging 'release' in 'main' - Releasing into Production
  • Loading branch information
boromir674 authored Aug 17, 2024
2 parents d0077a9 + 509c1af commit fa8140b
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 8 deletions.
37 changes: 29 additions & 8 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ jobs:
env:
# Git Ops Signal for dynamic Pipeline Configuration
BOARDING_MSG: "Auto Merging '[^']+' carrying '([^']+)' Changes"
MAIN_BRANCH: ${{ vars.GIT_MAIN_BRANCH || 'main' }}
RELEASE_BRANCH: ${{ vars.GIT_RELEASE_BRANCH || 'release' }}
steps:
# escape parethesis in commit message to prepare next step regex match
# escape should also handle multiline commit messages from ${{ github.event.head_commit.message }}
Expand Down Expand Up @@ -82,16 +84,36 @@ jobs:
echo PIPE_DOCS_GITOPS_POLICY='1' >> $GITHUB_ENV
fi
# if event ref is tag on 'main' branch, and tag includes one of [dev, rc] substrings,
# then use JOB_MATRIX_NO_RELEASE_ME (we do not need to check for main unless the on.branches: main changes)
- if: ${{ startsWith(github.event.ref, 'refs/tags/v') && ! ( contains(github.event.ref, 'dev') || contains(github.event.ref, 'rc') ) }}
run: echo _JOB_MATRIX="${JOB_MATRIX_NO_RELEASE_ME}" >> $GITHUB_ENV
- uses: actions/checkout@v4
with:
fetch-depth: 0 # 0 indicates all history for all branches and tags.

# Check if a tag was pushed on the 'release' branch
- if: startsWith(github.event.ref, 'refs/tags/v')
name: "Check if '${{ github.ref }}' tag is on '${{ env.RELEASE_BRANCH }}' branch"
uses: rickstaa/action-contains-tag@v1
id: release_contains_tag
with:
reference: ${{ env.RELEASE_BRANCH }}
tag: "${{ github.ref }}"

# if event ref is push to 'main' branch or on-demand pushed run-ci tag or rc/dev tag on release,
# then use FULL JOB_MATRIX
- if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' || github.event.ref == 'refs/tags/run-ci' || ( startsWith(github.event.ref, 'refs/tags/v') && ( contains(github.event.ref, 'dev') || contains(github.event.ref, 'rc') ) ) }}
# if v* tag on release, or push to main, or run-ci tag, then FULL JOB_MATRIX
- if: ${{ steps.release_contains_tag.outputs.retval == 'true' || github.event.ref == 'refs/heads/main' || github.event.ref == 'refs/tags/run-ci' }}
run: echo _JOB_MATRIX="${JOB_MATRIX}" >> $GITHUB_ENV

# Check if a tag was pushed on the 'main' branch
- if: startsWith(github.event.ref, 'refs/tags/v') && env._JOB_MATRIX == ''
name: "Check if '${{ github.ref }}' tag is on '${{ env.MAIN_BRANCH }}' branch"
uses: rickstaa/action-contains-tag@v1
id: main_contains_tag
with:
reference: ${{ env.MAIN_BRANCH }}
tag: "${{ github.ref }}"

# if v* tag on main, then PARTIAL JOB_MATRIX
- if: ${{ steps.main_contains_tag.outputs.retval == 'true' && env._JOB_MATRIX == '' }}
run: echo _JOB_MATRIX="${JOB_MATRIX_NO_RELEASE_ME}" >> $GITHUB_ENV

# Configure Pipeline, while respecting Higher level overrides
- name: Configure Pipeline
id: set_pipe_config
Expand All @@ -101,7 +123,6 @@ jobs:
echo PIPE_DOCS_PY="${{ env.DOCS_PY_VERSION }}" >> $GITHUB_OUTPUT
echo JOB_MATRIX="${_JOB_MATRIX}" >> $GITHUB_OUTPUT
outputs:
## TEST MATRIX ##
matrix: ${{ steps.set_pipe_config.outputs.JOB_MATRIX }}
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.

This project adheres to [Semantic Versioning](https://semver.org/).

## 1.8.1-dev1 (2024-09-17)

### Changes

#### CI
- fix conditional logic that dynamically selects Job Matrix


## 1.8.1-dev (2024-09-17)

### Changes
Expand Down

0 comments on commit fa8140b

Please sign in to comment.