Skip to content

Commit 351996e

Browse files
committed
feat: add ci
1 parent af66a0b commit 351996e

File tree

1 file changed

+31
-28
lines changed

1 file changed

+31
-28
lines changed

.github/workflows/ci.yml

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ name: Release Version
22

33
on:
44
pull_request:
5-
types: [opened, synchronize]
5+
types: [closed]
66

77
jobs:
8-
request-version:
8+
check-merge:
9+
if: github.event.pull_request.merged == true
910
runs-on: ubuntu-latest
1011

1112
steps:
@@ -28,8 +29,9 @@ jobs:
2829
})
2930
3031
check-version:
32+
if: github.event.pull_request.merged == true
3133
runs-on: ubuntu-latest
32-
needs: request-version
34+
needs: check-merge
3335
steps:
3436
- name: Check version bump reaction
3537
uses: actions/github-script@v6
@@ -53,34 +55,35 @@ jobs:
5355
console.log(`Version to bump: ${versionType}`);
5456
core.setOutput('version_type', versionType);
5557
56-
# release:
57-
# runs-on: ubuntu-latest
58-
# needs: check-version
59-
# steps:
60-
# - name: Checkout code
61-
# uses: actions/checkout@v3
58+
release:
59+
if: github.event.pull_request.merged == true
60+
runs-on: ubuntu-latest
61+
needs: check-version
62+
steps:
63+
- name: Checkout code
64+
uses: actions/checkout@v3
6265

63-
# - name: Setup Node.js
64-
# uses: actions/setup-node@v3
65-
# with:
66-
# node-version: '16'
67-
# registry-url: 'https://registry.npmjs.org/'
66+
- name: Setup Node.js
67+
uses: actions/setup-node@v3
68+
with:
69+
node-version: '16'
70+
registry-url: 'https://registry.npmjs.org/'
6871

69-
# - name: Install dependencies
70-
# run: yarn install
72+
- name: Install dependencies
73+
run: yarn install
7174

72-
# - name: Bump version
73-
# run: |
74-
# yarn version --${{ needs.check-version.outputs.version_type }}
75+
- name: Bump version
76+
run: |
77+
yarn version --${{ needs.check-version.outputs.version_type }}
7578
76-
# - name: Build project
77-
# run: yarn build
79+
- name: Build project
80+
run: yarn build
7881

79-
# - name: Publish to NPM
80-
# run: |
81-
# echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
82-
# yarn publish --non-interactive
82+
- name: Publish to NPM
83+
run: |
84+
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
85+
yarn publish --non-interactive
8386
84-
# - name: Push changes and tags
85-
# run: |
86-
# git push --follow-tags
87+
- name: Push changes and tags
88+
run: |
89+
git push --follow-tags

0 commit comments

Comments
 (0)