forked from yext/studio
-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (59 loc) · 1.89 KB
/
release.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Release Studio
on:
push:
# branches: main
jobs:
release:
runs-on: ubuntu-latest
# if: startsWith(github.event.head_commit.message, 'simple')
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- name: check commit name
id: vars
run: |
COMMIT_MSG="${{ github.event.head_commit.message }}"
COMMIT_TITLE="${COMMIT_MSG%%$'\n'*}"
echo "${COMMIT_TITLE}"
if [[ $COMMIT_TITLE =~ ^(v|Version )[0-9]+\.[0-9]+\.[0-9]+( \(#[0-9]+\))?$ ]]
then
echo "matched regex"
PACKAGE_VERSION="${COMMIT_TITLE#Version }"
PACKAGE_VERSION="${PACKAGE_VERSION#v}"
PACKAGE_VERSION="${PACKAGE_VERSION%% *}"
echo "${PACKAGE_VERSION}"
echo version=${PACKAGE_VERSION} >> $GITHUB_OUTPUT
else
echo "did not match"
fi
- name: check package versions
run: |
if node ./bump-versions.mjs ${{ steps.vars.outputs.version }} &> temp-bump-versions.txt
then
echo "Package versions did not match ${{ steps.vars.outputs.version }}."
exit 1
fi
if
grep -zq 'bumping studio-plugin' temp-bump-versions.txt
then
if git diff --exit-code
then
echo "Success"
exit 1
fi
echo "Found unexpected git diff from running the bump-versions.mjs script."
exit 1
fi
echo "Error running the bump-version.mjs script."
cat temp-bump-versions.txt
exit 1
- name: check linting
run: |
npm run autofix
if git diff --exit-code
exit 0
fi
echo "Found unexpected git diff from running `npm run autofix`."
exit 1
- name: run tests
uses: ./.github/workflows/run-tests.yml