-
Notifications
You must be signed in to change notification settings - Fork 141
65 lines (63 loc) · 2.23 KB
/
startRelease.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
61
62
63
64
65
name: start release
on:
workflow_dispatch:
inputs:
prerelease:
type: boolean
description: 'プレリリース'
manual_preparation:
type: boolean
description: '前リリースタグとの合流を手動で行う'
jobs:
start_release:
runs-on: ubuntu-latest
env:
RESULT_PATH: /tmp/result.txt
IS_PRERELEASE: ${{ github.event.inputs.prerelease == 'true' }}
NO_BRANCH_PREPARATION: ${{ github.event.inputs.manual_preparation == 'true' }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
- name: git config
run: |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
- name: prepare release
if: ${{ env.NO_BRANCH_PREPARATION == 'false' }}
run: |
BASE_TAG=v$(npx -c 'echo "$npm_package_version"')
git checkout $BASE_TAG
git merge --no-edit ${{ github.ref }}
- run: yarn install --frozen-lockfile
- name: release dry run
if: ${{ env.IS_PRERELEASE == 'false' }}
run: yarn release:dryrun > ${{ env.RESULT_PATH }}
- name: prerelease dry run
if: ${{ env.IS_PRERELEASE == 'true' }}
run: yarn release:dryrun --prerelease > ${{ env.RESULT_PATH }}
- name: wrap dry run log
run: |
echo "Dry Run Log:
\`\`\`
$(cat ${{ env.RESULT_PATH }})
\`\`\`" > ${{ env.RESULT_PATH }}
- name: push branch
run: |
git checkout -b release-candidate
git push origin release-candidate
- name: release issue labels
if: ${{ env.IS_PRERELEASE == 'false' }}
run: echo ISSUE_LABELS='release candidate' >> $GITHUB_ENV
- name: prerelease issue labels
if: ${{ env.IS_PRERELEASE == 'true' }}
run: echo ISSUE_LABELS='release candidate, prerelease' >> $GITHUB_ENV
- name: create issue
uses: peter-evans/create-issue-from-file@v4
with:
title: Release candidate
content-filepath: ${{ env.RESULT_PATH }}
labels: ${{ env.ISSUE_LABELS }}