Skip to content

Commit

Permalink
fix(matrix): use gh actions matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
masoudmanson committed Sep 6, 2023
1 parent 013a3b4 commit d4ae6e9
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 433 deletions.
36 changes: 0 additions & 36 deletions .github/workflows/chromatic.yml

This file was deleted.

22 changes: 0 additions & 22 deletions .github/workflows/commitlint.yml

This file was deleted.

35 changes: 18 additions & 17 deletions .github/workflows/gh-release-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,35 @@ on:
- "*"

jobs:
version_check_and_tag:
create_version_matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}

steps:
# Step 1: Check out the repository code
- name: Checkout
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set Current Versions
id: set_versions
- name: Create Version Matrix
id: set-matrix
run: |
CURRENT_VERSIONS=""
CURRENT_VERSIONS="["
for package_json in $(find ./packages -name package.json); do
version=$(jq -r .version $package_json)
CURRENT_VERSIONS="${CURRENT_VERSIONS}${version},"
CURRENT_VERSIONS="${CURRENT_VERSIONS}{\"version\":\"${version}\"},"
done
CURRENT_VERSIONS=${CURRENT_VERSIONS%,} # Remove trailing comma
CURRENT_VERSIONS="${CURRENT_VERSIONS%,}]" # Remove trailing comma
echo "CURRENT_VERSIONS=${CURRENT_VERSIONS}" >> $GITHUB_ENV
- name: Run Version Check and Tag for Each Version
run: |
for version in $(echo $CURRENT_VERSIONS | tr ',' ' '); do
echo "Creating job for version $version..."
echo "VERSION=${version}" >> $GITHUB_ENV
done
- name: Create Release
run: |
echo "Running release job for individual tag ${{ steps.set_versions.outputs.version }}"
create_github_release:
needs: create_version_matrix
runs-on: ubuntu-latest
strategy:
matrix:
cfg: ${{fromJson(needs.create_version_matrix.outputs.CURRENT_VERSIONS)}}
steps:
- run: |
echo "Run GH release for ${{ matrix.cfg.version }}"
28 changes: 0 additions & 28 deletions .github/workflows/github-release.yml

This file was deleted.

35 changes: 0 additions & 35 deletions .github/workflows/namespace-check.yml

This file was deleted.

86 changes: 0 additions & 86 deletions .github/workflows/push-tests.yml

This file was deleted.

120 changes: 0 additions & 120 deletions .github/workflows/release.yml

This file was deleted.

Loading

0 comments on commit d4ae6e9

Please sign in to comment.