start release #141
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |