9
9
jobs :
10
10
versioning :
11
11
runs-on : ubuntu-latest
12
+ outputs :
13
+ commit_message : ${{ steps.capture_commit_message.outputs.commit_message }}
12
14
steps :
13
15
- uses : actions/checkout@v2
14
16
with :
@@ -23,21 +25,32 @@ jobs:
23
25
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
24
26
- name : Show Git Status
25
27
run : git status
28
+ - name : Capture Commit Message
29
+ id : capture_commit_message
30
+ run : echo "::set-output name=commit_message::$(git log -1 --pretty=%B)"
26
31
- name : Release with release-it
27
32
run : |
28
- commit_message="${{ github.event.head_commit.message }}"
33
+ commit_message="${{ steps.capture_commit_message.outputs.commit_message }}"
29
34
if [[ "$commit_message" == *"[alpha]"* ]]; then
30
35
npx release-it minor --preRelease=alpha --ci
31
36
else
32
37
npx release-it --ci
33
38
fi
34
39
env :
35
40
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
41
+
36
42
deploy :
37
43
needs : versioning
38
44
runs-on : ubuntu-latest
39
45
steps :
40
46
- uses : actions/checkout@v2
47
+ with :
48
+ fetch-depth : 0
49
+ - name : Fetch latest changes
50
+ run : |
51
+ git fetch --prune
52
+ git checkout master
53
+ git pull
41
54
- name : Install Vercel CLI
42
55
run : npm install --global vercel@latest
43
56
- name : Pull Vercel Environment Information
@@ -46,12 +59,19 @@ jobs:
46
59
run : vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
47
60
- name : Deploy Project Artifacts to Vercel
48
61
run : vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}
62
+
49
63
release-npm :
50
64
needs : deploy
51
65
runs-on : ubuntu-latest
52
66
steps :
53
- - uses : actions/checkout@v4
54
- # Setup .npmrc file to publish to npm
67
+ - uses : actions/checkout@v2
68
+ with :
69
+ fetch-depth : 0
70
+ - name : Fetch latest changes
71
+ run : |
72
+ git fetch --prune
73
+ git checkout master
74
+ git pull
55
75
- uses : actions/setup-node@v3
56
76
with :
57
77
registry-url : ' https://registry.npmjs.org'
61
81
run : npm run build
62
82
- name : Release
63
83
run : |
64
- commit_message="${{ github.event.head_commit.message }}"
84
+ commit_message="${{ needs.versioning.outputs.commit_message }}"
65
85
if [[ "$commit_message" == *"[alpha]"* ]]; then
66
86
cd dist/bundle && npm publish --tag alpha --access public --non-interactive
67
87
else
0 commit comments