-
Notifications
You must be signed in to change notification settings - Fork 7
40 lines (35 loc) · 1.08 KB
/
gh-release-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Version Check and Tag
on:
push:
branches:
- "*"
jobs:
create_version_matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
# Step 1: Check out the repository code
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Create Version Matrix
id: set-matrix
run: |
CURRENT_VERSIONS="["
for package_json in $(find ./packages -name package.json); do
version=$(jq -r .version $package_json)
CURRENT_VERSIONS="${CURRENT_VERSIONS}{\"version\":\"${version}\"},"
done
CURRENT_VERSIONS="${CURRENT_VERSIONS%,}]" # Remove trailing comma
echo "CURRENT_VERSIONS=${CURRENT_VERSIONS}" >> $GITHUB_ENV
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 }}"