-
Notifications
You must be signed in to change notification settings - Fork 7
39 lines (33 loc) · 1.11 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
name: Version Check and Tag
on:
push:
branches:
- "*"
jobs:
version_check_and_tag:
runs-on: ubuntu-latest
steps:
# Step 1: Check out the repository code
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set Current Versions
id: set_versions
run: |
CURRENT_VERSIONS=""
for package_json in $(find ./packages -name package.json); do
version=$(jq -r .version $package_json)
CURRENT_VERSIONS="${CURRENT_VERSIONS}${version},"
done
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 }}"