Skip to content

chore(deps-dev): bump @semantic-release/github from 11.0.2 to 12.0.1 #561

chore(deps-dev): bump @semantic-release/github from 11.0.2 to 12.0.1

chore(deps-dev): bump @semantic-release/github from 11.0.2 to 12.0.1 #561

Workflow file for this run

name: GitFlow Workflow
on:
push:
branches:
- develop
- main
pull_request:
branches:
- feature/*
- develop
- main
env:
WORKFLOW_VERSION: 1.2.0
jobs:
initialize:
name: Initialize
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ github.token }}
- name: Print all github variables
run: echo "$JSON"
env:
JSON: ${{ toJson(github) }}
- uses: actions/checkout@v4
- id: files
uses: tj-actions/changed-files@v46.0.5
- name: List files modified
id: project_list
run: |
echo ${{ steps.files.outputs.all_changed_files }} | sed -E 's/ /\n/g' > modified_files.txt
echo "## Modified Files"
cat modified_files.txt
cat modified_files.txt | ./tooling/scripts/parse_file_list_for_projects.sh > project_list.txt
- name: Get PR Info
id: e2e
run: |
SKIP_E2E="$(./tooling/scripts/determine_skip_e2e.sh)"
echo "skipE2E=$SKIP_E2E" >> $GITHUB_OUTPUT
env:
GH_TOKEN: ${{ github.token }}
EVENT_NUMBER: ${{ github.event.number }}
- name: Set Dynamic Matrix
id: setmatrix
run: |
echo "## Project List"
cat project_list.txt
export SKIP_E2E=${{ steps.e2e.outputs.skipE2E }}
matrixStringifiedObject="$(cat project_list.txt | ./tooling/scripts/generate_matrix.sh)"
export JOB_NAME=unitTest
matrixStringifiedObjectUnitTest="$(cat project_list.txt | ./tooling/scripts/generate_matrix.sh)"
echo "## Matrix Object (Unit Tests)"
echo "$matrixStringifiedObjectUnitTest" | jq
echo "matrix-unit-test=$matrixStringifiedObjectUnitTest" >> $GITHUB_OUTPUT
export JOB_NAME=featureTest
matrixStringifiedObjectFeatureTest="$(cat project_list.txt | ./tooling/scripts/generate_matrix.sh)"
echo "## Matrix Object (Feature Tests)"
echo "$matrixStringifiedObjectFeatureTest" | jq
echo "matrix-feature-test=$matrixStringifiedObjectFeatureTest" >> $GITHUB_OUTPUT
export JOB_NAME=deployment
matrixStringifiedObjectDeployment="$(cat project_list.txt | ./tooling/scripts/generate_matrix.sh)"
echo "## Matrix Object (Deployment)"
echo "$matrixStringifiedObjectDeployment" | jq
echo "matrix-deployment=$matrixStringifiedObjectDeployment" >> $GITHUB_OUTPUT
outputs:
matrix-unit-test: ${{ steps.setmatrix.outputs.matrix-unit-test }}
matrix-feature-test: ${{ steps.setmatrix.outputs.matrix-feature-test }}
matrix-deployment: ${{ steps.setmatrix.outputs.matrix-deployment }}
files: ${{ steps.files.outputs.all_changed_files }}
unit-tests:
name: Unit Tests
needs: [initialize]
strategy:
matrix: ${{ fromJson(needs.initialize.outputs.matrix-unit-test) }}
runs-on: ${{ matrix.os }}
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Install Dependencies
run: |
sudo apt install figlet
working-directory: projects/${{ matrix.project }}
- name: Setup Node
run: |
npm i
working-directory: projects/${{ matrix.project }}
- name: Install Dependencies
run: |
npm run install:dependencies
env:
PROJECT: ${{ matrix.project }}
- name: Run Unit Tests
run: |
export BRANCH_NAME=$(if [ -z "${{ github.head_ref }}" ]; then echo "${{ github.ref_name }}"; else echo "${{ github.head_ref }}"; fi)
npm run test
working-directory: projects/${{ matrix.project }}
env:
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN }}
HEAD_SHA: ${{ github.event.after }}
TARGET: ${{ matrix.target }}
feature-tests:
name: Feature Tests
needs: [initialize]
environment: sandbox
strategy:
matrix: ${{ fromJson(needs.initialize.outputs.matrix-feature-test) }}
runs-on: ${{ matrix.os }}
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Setup Node
run: |
npm i
working-directory: projects/${{ matrix.project }}
- name: Install Dependencies
run: |
npm run install:dependencies
env:
PROJECT: ${{ matrix.project }}
- name: Run Feature Tests
run: |
export BRANCH_NAME=$(if [ -z "${{ github.head_ref }}" ]; then echo "${{ github.ref_name }}"; else echo "${{ github.head_ref }}"; fi)
npm run test:e2e
working-directory: projects/${{ matrix.project }}
env:
MODIFIED_FILES: ${{ needs.initialize.outputs.files }}
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN }}
HEAD_SHA: ${{ github.event.after }}
TARGET: ${{ matrix.target }}
deploy-check:
name: Deployment Check
needs: [unit-tests, feature-tests]
runs-on: ubuntu-latest
timeout-minutes: 1
steps:
- uses: actions/checkout@v4
- name: Get PR Info
id: cd
run: |
SKIP_CD="$(./tooling/scripts/determine_skip_cd.sh)"
echo "skipCD=$SKIP_CD" >> $GITHUB_OUTPUT
if [ "$SKIP_CD" == "true" ]; then
echo "Deployment will be skipped"
exit 1
fi
env:
GH_TOKEN: ${{ github.token }}
EVENT_NUMBER: ${{ github.event.number }}
- name: Announce Deployment
if: steps.cd.outputs.skipCD != 'true'
run: echo "This will be deployed"
outputs:
skipCD: ${{ steps.cd.outputs.skipCD }}
check_release:
name: Check Release
timeout-minutes: 5
if: |
startsWith(github.head_ref,'release/v') || startsWith(github.head_ref,'hotfix/v') ||
(github.event_name == 'push' && github.ref == 'refs/heads/main')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Dependencies
run: |
sudo apt install figlet
- name: Test the script
run: |
tooling/scripts/tests/check_release_version_test.sh "$(pwd)/tooling/scripts/check_release_version.sh" "$(pwd)/tooling/scripts/tests"
- name: Confirm Release Version
run: |
tooling/scripts/check_release_version.sh
env:
CURRENT_BRANCH: ${{ github.head_ref }}
TARGET_BRANCH: ${{ github.base_ref }}
EVENT: ${{ github.event_name }}
deploy_pull_request:
name: Deploy Pull Request
needs: [deploy-check, initialize]
environment: sandbox
strategy:
matrix: ${{ fromJson(needs.initialize.outputs.matrix-deployment) }}
runs-on: ${{ matrix.os }}
timeout-minutes: 15
if: |
needs.deploy-check.outputs.skipCD != 'true' &&
github.event_name == 'pull_request' &&
github.base_ref == 'develop' &&
!(startsWith(github.head_ref,'release/v') || startsWith(github.head_ref,'hotfix/v'))
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Setup Node
run: |
npm i
working-directory: projects/${{ matrix.project }}
- name: Install Dependencies
run: |
npm run install:dependencies
env:
PROJECT: ${{ matrix.project }}
- name: Deploy Pull Request
run: |
export BRANCH_NAME=$(if [ -z "${{ github.head_ref }}" ]; then echo "${{ github.ref_name }}"; else echo "${{ github.head_ref }}"; fi)
echo "Deploy IDENTIFIER=$IDENTIFIER to a pull request environment"
npm run deploy:pr
working-directory: projects/${{ matrix.project }}
env:
MODIFIED_FILES: ${{ needs.initialize.outputs.files }}
IDENTIFIER: ${{ github.event.number }}
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN }}
HEAD_SHA: ${{ github.event.after }}
TARGET: ${{ matrix.target }}
semantic_pre_release:
name: Semantic Pre Release
needs: [deploy-check, initialize]
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: write
if: |
needs.deploy-check.outputs.skipCD != 'true' &&
github.event_name == 'push' &&
github.ref == 'refs/heads/develop'
outputs:
new-tag: ${{ steps.get-new-release.output.new-tag }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Get Current Release
run: |
git fetch
CURRENT_TAG=$(./tooling/scripts/git_latest_version_tag.sh)
echo ::set-output name=current-tag::$CURRENT_TAG
echo Current Tag: $CURRENT_TAG
id: get-current-release
- name: Run semantic release
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN }}
- name: Get New Release
run: |
git fetch
NEW_TAG=$(tooling/scripts/git_latest_version_tag.sh)
echo ::set-output name=new-tag::$NEW_TAG
echo New Tag: $NEW_TAG
id: get-new-release
deploy_to_develop:
name: Deploy to Develop
needs: [semantic_pre_release,initialize]
environment: develop
strategy:
matrix: ${{ fromJson(needs.initialize.outputs.matrix-deployment) }}
runs-on: ${{ matrix.os }}
timeout-minutes: 15
if: |
needs.deploy-check.outputs.skipCD != 'true' &&
github.event_name == 'push' &&
github.ref == 'refs/heads/develop'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Setup Node
run: |
npm i
working-directory: projects/${{ matrix.project }}
- name: Install Dependencies
run: |
npm run install:dependencies
env:
PROJECT: ${{ matrix.project }}
- name: Deploy to Develop
run: |
export BRANCH_NAME=$(if [ -z "${{ github.head_ref }}" ]; then echo "${{ github.ref_name }}"; else echo "${{ github.head_ref }}"; fi)
echo "Deploy to the develop environment"
npm run deploy:develop
working-directory: projects/${{ matrix.project }}
env:
MODIFIED_FILES: ${{ needs.initialize.outputs.files }}
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN }}
HEAD_SHA: ${{ github.event.after }}
TARGET: ${{ matrix.target }}
deploy_to_staging:
name: Deploy to Staging
needs: [deploy-check, check_release, initialize]
environment: staging
strategy:
matrix: ${{ fromJson(needs.initialize.outputs.matrix-deployment) }}
runs-on: ${{ matrix.os }}
timeout-minutes: 15
if: |
needs.deploy-check.outputs.skipCD != 'true' &&
github.event_name == 'pull_request' && github.base_ref == 'main' &&
(startsWith(github.head_ref, 'release/v') || startsWith(github.head_ref, 'hotfix/v'))
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Setup Node
run: |
npm i
working-directory: projects/${{ matrix.project }}
- name: Install Dependencies
run: |
npm run install:dependencies
env:
PROJECT: ${{ matrix.project }}
- name: Deploy to Staging
run: |
export BRANCH_NAME=$(if [ -z "${{ github.head_ref }}" ]; then echo "${{ github.ref_name }}"; else echo "${{ github.head_ref }}"; fi)
echo "Deploy to the staging environment"
npm run deploy:staging
working-directory: projects/${{ matrix.project }}
env:
MODIFIED_FILES: ${{ needs.initialize.outputs.files }}
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN }}
HEAD_SHA: ${{ github.event.after }}
TARGET: ${{ matrix.target }}
semantic_release:
name: Semantic Release
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: write
needs: [deploy-check, check_release]
if: |
needs.deploy-check.outputs.skipCD != 'true' &&
github.event_name == 'push' &&
github.ref == 'refs/heads/main'
outputs:
new-tag: ${{ steps.get-new-release.output.new-tag }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Get Current Release
run: |
git fetch
CURRENT_TAG=$(./tooling/scripts/git_latest_version_tag.sh)
echo ::set-output name=current-tag::$CURRENT_TAG
echo Current Tag: $CURRENT_TAG
id: get-current-release
- name: Run semantic release
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN }}
- name: Get New Release
run: |
git fetch
NEW_TAG=$(tooling/scripts/git_latest_version_tag.sh)
echo ::set-output name=new-tag::$NEW_TAG
echo New Tag: $NEW_TAG
id: get-new-release
deploy_to_production:
name: Deploy to Production
needs: [semantic_release,initialize]
environment: production
strategy:
matrix: ${{ fromJson(needs.initialize.outputs.matrix-deployment) }}
runs-on: ${{ matrix.os }}
timeout-minutes: 15
if: |
github.event_name == 'push' &&
github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Print all github variables
run: echo "$JSON"
env:
JSON: ${{ toJson(github) }}
- name: Setup Node
run: |
npm i
working-directory: projects/${{ matrix.project }}
- name: Install Dependencies
run: |
npm run install:dependencies
env:
PROJECT: ${{ matrix.project }}
- name: Deploy to Production
run: |
export BRANCH_NAME=$(if [ -z "${{ github.head_ref }}" ]; then echo "${{ github.ref_name }}"; else echo "${{ github.head_ref }}"; fi)
echo "Deploy to the production environment"
npm run deploy:production
working-directory: projects/${{ matrix.project }}
env:
MODIFIED_FILES: ${{ needs.initialize.outputs.files }}
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN }}
HEAD_SHA: ${{ github.event.after }}
TARGET: ${{ matrix.target }}