@@ -2,6 +2,10 @@ name: Build
2
2
3
3
on : [ push, pull_request, workflow_dispatch ]
4
4
5
+ env :
6
+ CI_WUI_BRANCH : ${{ vars.CI_WUI_BRANCH }}
7
+ CI_WUI_DISABLE_LOCAL_PUBLISH : ${{ vars.CI_WUI_DISABLE_LOCAL_PUBLISH }}
8
+
5
9
jobs :
6
10
build :
7
11
runs-on : ubuntu-latest
@@ -18,11 +22,32 @@ jobs:
18
22
repository : TAMULib/Weaver-UI-Core
19
23
path : weaver-ui
20
24
ref : 2.x
25
+ # Specify depth of 0 to enable fetching all branches and tags so that the "Use Custom Weaver-UI-Core Repo Version" works.
26
+ fetch-depth : 0
27
+
28
+ - name : " Detect Custom Weaver-UI-Core Repo Version"
29
+ continue-on-error : true
30
+ if : ${{ env.CI_WUI_BRANCH == '' }}
31
+ run : |
32
+ cd weaver-ui
33
+ export CI_WUI_BRANCH_VERSION=$(grep -so -m 1 '"@wvr/core": "[^"]*"' ../repo/package.json | sed -e 's|"@wvr/core": "||' -e 's|"$||')
34
+ export CI_WUI_BRANCH=$(git tag | grep -so -m 1 "^$CI_WUI_BRANCH_VERSION$")
35
+ # Some projects prefix their version with a "v".
36
+ if [[ $CI_WUI_BRANCH == "" && $CI_WUI_BRANCH_VERSION != "" ]] ; then export CI_WUI_BRANCH=$(git tag | grep -so -m 1 "^v$CI_WUI_BRANCH_VERSION$") ; fi
37
+ echo "CI_WUI_BRANCH=$CI_WUI_BRANCH" >> $GITHUB_ENV
38
+
39
+ - name : " Use Custom Weaver-UI-Core Repo Version"
40
+ continue-on-error : true
41
+ if : ${{ env.CI_WUI_BRANCH != '' }}
42
+ run : |
43
+ cd weaver-ui
44
+ git reset --hard $CI_WUI_BRANCH
21
45
22
46
- name : " Run Weaver-UI-Core Docker Compose Registry Image"
23
47
run : docker-compose -f $GITHUB_WORKSPACE/weaver-ui/docker-compose.yml up -d registry
24
48
25
49
- name : " Publish Weaver-UI-Core (@wvr/core)"
50
+ if : ${{ env.CI_WUI_DISABLE_LOCAL_PUBLISH != 'true' }}
26
51
run : |
27
52
cd $GITHUB_WORKSPACE/weaver-ui
28
53
npm run publish:local
0 commit comments