Skip to content

Commit 900a18a

Browse files
committed
Merge pull request #1 from BadJacky/feature/dynamic-ripple-version-in-ci
feature: dynamically set laravel-ripple version in CI workflows
2 parents 71274bb + 87f0ad2 commit 900a18a

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

.github/workflows/octane.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ on:
55
push:
66
branches:
77
- main
8-
- feature/*
98
pull_request:
109
branches:
1110
- main
11+
- feature/*
1212

1313
jobs:
1414
test-unix:
@@ -47,12 +47,17 @@ jobs:
4747
- name: Initialize ripple
4848
working-directory: app
4949
run: |
50+
echo "DEBUG---github.ref_name: ${{ github.ref_name }}"
51+
echo "DEBUG---PR_BRANCH_NAME: $PR_BRANCH_NAME"
52+
if [ ${{ github.ref_name }} = "main" ]; then
53+
VERSION="dev-main"
54+
else
55+
VERSION="dev-${{ github.sha }}"
56+
fi
5057
composer config repositories.local-plugin path ../
5158
composer clear-cache
5259
composer config minimum-stability dev
53-
composer require cloudtay/laravel-ripple:dev-${{ github.sha }}
54-
composer require laravel/octane
55-
60+
composer require cloudtay/laravel-ripple:$VERSION
5661
# 初始化测试路由
5762
- name: Initialize Test Route
5863
working-directory: app

.github/workflows/unix.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ on:
55
push:
66
branches:
77
- main
8-
- feature/*
98
pull_request:
109
branches:
1110
- main
11+
- feature/*
1212

1313
jobs:
1414
test-unix:
@@ -46,10 +46,17 @@ jobs:
4646
- name: Initialize ripple
4747
working-directory: app
4848
run: |
49+
echo "DEBUG---github.ref_name: ${{ github.ref_name }}"
50+
echo "DEBUG---github.sha: ${{ github.sha }}"
51+
if [ ${{ github.ref_name }} = "main" ]; then
52+
VERSION="dev-main"
53+
else
54+
VERSION="dev-${{ github.sha }}"
55+
fi
4956
composer config repositories.local-plugin path ../
5057
composer clear-cache
5158
composer config minimum-stability dev
52-
composer require cloudtay/laravel-ripple:dev-${{ github.sha }}
59+
composer require cloudtay/laravel-ripple:$VERSION
5360
# 初始化测试路由
5461
- name: Initialize Test Route
5562
working-directory: app

0 commit comments

Comments
 (0)