File tree 1 file changed +13
-2
lines changed
1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 23
23
uses : actions/cache@v3
24
24
with :
25
25
path : node_modules
26
- key : ${{ runner.os }}-node-modules-${{ hashFiles('package-lock.json ') }}
26
+ key : ${{ runner.os }}-node-modules-${{ hashFiles('yarn.lock ') }}
27
27
restore-keys : |
28
28
${{ runner.os }}-node-modules-
29
29
@@ -35,17 +35,27 @@ jobs:
35
35
run : npm run build
36
36
37
37
- name : Bump version and release
38
+ id : semantic_release
38
39
env :
39
40
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
40
- run : npx semantic-release
41
+ run : |
42
+ npx semantic-release | tee semantic_release_output.txt
43
+ if grep -q "Published release" semantic_release_output.txt; then
44
+ echo "NEW_VERSION_RELEASED=true" >> $GITHUB_ENV
45
+ else
46
+ echo "NEW_VERSION_RELEASED=false" >> $GITHUB_ENV
47
+ fi
48
+ continue-on-error : true
41
49
42
50
- name : Retrieve plugin version and name
51
+ if : ${{ env.NEW_VERSION_RELEASED == 'true' }}
43
52
id : get_version
44
53
run : |
45
54
echo "PLUGIN_VERSION=$(node -p -e "require('./package.json').version")" >> $GITHUB_ENV
46
55
echo "PLUGIN_NAME=$(node -p -e "require('./package.json').name")" >> $GITHUB_ENV
47
56
48
57
- name : Zip build files in a temporary directory
58
+ if : ${{ env.NEW_VERSION_RELEASED == 'true' }}
49
59
run : |
50
60
mkdir -p /tmp/build
51
61
mkdir -p /tmp/build/${PLUGIN_NAME}-${PLUGIN_VERSION}
54
64
zip -r ${{ env.PLUGIN_NAME }}-${{ env.PLUGIN_VERSION }}.zip ${PLUGIN_NAME}-${PLUGIN_VERSION}
55
65
56
66
- name : Create release and attach zip file
67
+ if : ${{ env.NEW_VERSION_RELEASED == 'true' }}
57
68
env :
58
69
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
59
70
run : |
You can’t perform that action at this time.
0 commit comments