Skip to content

Commit 4298d09

Browse files
committed
chore: simplify release workflows
1 parent 3a196ac commit 4298d09

File tree

2 files changed

+6
-54
lines changed

2 files changed

+6
-54
lines changed
Lines changed: 4 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
name: Ship js Manual Prepare
2-
on:
3-
issue_comment:
4-
types: [created]
2+
on: workflow_dispatch
53
jobs:
64
manual_prepare:
7-
if: |
8-
github.event_name == 'issue_comment' &&
9-
(github.event.comment.author_association == 'member' || github.event.comment.author_association == 'owner') &&
10-
startsWith(github.event.comment.body, '@shipjs prepare')
115
runs-on: ubuntu-latest
126
steps:
137
- uses: actions/checkout@v2
@@ -16,49 +10,12 @@ jobs:
1610
ref: main
1711
- uses: actions/setup-node@v2
1812
with:
19-
node-version: '14'
20-
- run: |
21-
if [ -f "yarn.lock" ]; then
22-
yarn install
23-
else
24-
npm install
25-
fi
13+
node-version: '16'
14+
- run: yarn install --frozen-lockfile
2615
- run: |
2716
git config --global user.email "github-actions[bot]@users.noreply.github.com"
2817
git config --global user.name "github-actions[bot]"
29-
- run: npm run release -- --yes --no-browse
18+
- run: yarn release --yes --no-browse
3019
env:
3120
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3221
SLACK_INCOMING_HOOK: ${{ secrets.SLACK_INCOMING_HOOK }}
33-
34-
create_done_comment:
35-
if: success()
36-
needs: manual_prepare
37-
runs-on: ubuntu-latest
38-
steps:
39-
- uses: actions/github-script@v3
40-
with:
41-
github-token: ${{ secrets.GITHUB_TOKEN }}
42-
script: |
43-
github.issues.createComment({
44-
issue_number: context.issue.number,
45-
owner: context.repo.owner,
46-
repo: context.repo.repo,
47-
body: "@${{github.actor}} `shipjs prepare` done"
48-
})
49-
50-
create_fail_comment:
51-
if: cancelled() || failure()
52-
needs: manual_prepare
53-
runs-on: ubuntu-latest
54-
steps:
55-
- uses: actions/github-script@v3
56-
with:
57-
github-token: ${{ secrets.GITHUB_TOKEN }}
58-
script: |
59-
github.issues.createComment({
60-
issue_number: context.issue.number,
61-
owner: context.repo.owner,
62-
repo: context.repo.repo,
63-
body: "@${{github.actor}} `shipjs prepare` fail"
64-
})

.github/workflows/shipjs-trigger.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,9 @@ jobs:
1515
ref: main
1616
- uses: actions/setup-node@v2
1717
with:
18-
node-version: '14'
1918
registry-url: "https://registry.npmjs.org"
20-
- run: |
21-
if [ -f "yarn.lock" ]; then
22-
yarn install
23-
else
24-
npm install
25-
fi
19+
node-version: '16'
20+
- run: yarn install --frozen-lockfile
2621
- run: npx shipjs trigger
2722
env:
2823
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)