PRマージのトリガーによる自動リリースプロセス全体がエラーなく連動して動作するよう、不備をすべて解消 - bump-and-tag.yml の paths-ignore から .github/workflows/** を削除 - release.yml および publish.yml に workflow_call 用 of tag 引数を追加し、 checkout ref に適用 - release.yml のバージョン取得処理で tag 引数がある場合はそれを優先するようフォールバック処理を追加 - bump-and-tag.yml の呼び出し部分に tag 引数の引き渡しを追加
68 lines
2.0 KiB
YAML
68 lines
2.0 KiB
YAML
name: release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v[0-9]+\\.[0-9]+\\.[0-9]+"
|
|
workflow_call:
|
|
inputs:
|
|
tag:
|
|
required: false
|
|
type: string
|
|
|
|
jobs:
|
|
create_release:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
ref: ${{ inputs.tag || github.ref }}
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
cache: 'npm'
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
- name: Build TypeScript code
|
|
run: npm run build
|
|
- name: version
|
|
id: version
|
|
run: |
|
|
REPOSITORY=$(echo ${{ github.event.repository.name }})
|
|
echo "repository=$REPOSITORY" >> "$GITHUB_OUTPUT"
|
|
|
|
INPUT_TAG="${{ inputs.tag }}"
|
|
if [ -n "$INPUT_TAG" ]; then
|
|
VERSION="$INPUT_TAG"
|
|
else
|
|
VERSION=$(basename ${{ github.ref }})
|
|
fi
|
|
|
|
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
|
|
VERSION_STRING=$(echo $VERSION | sed -e "s#\.#_#g")
|
|
echo "version_string=$VERSION_STRING" >> "$GITHUB_OUTPUT"
|
|
- name: Zip output
|
|
id: create_zip
|
|
run: |
|
|
ARCHIVE_BASENAME=$(echo ${{steps.version.outputs.repository}}-${{steps.version.outputs.version_string}})
|
|
ARCHIVE_FILENAME=$(echo $ARCHIVE_BASENAME.zip)
|
|
|
|
echo "filename=$ARCHIVE_FILENAME" >> "$GITHUB_OUTPUT"
|
|
|
|
mkdir $ARCHIVE_BASENAME
|
|
rsync -av ./* $ARCHIVE_BASENAME --exclude $ARCHIVE_BASENAME
|
|
zip -r $ARCHIVE_FILENAME $ARCHIVE_BASENAME -x ".git"
|
|
- name: Create Release
|
|
id: create-release
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
name: Release ${{ steps.version.outputs.version }}
|
|
tag_name: ${{ steps.version.outputs.version }}
|
|
draft: true
|
|
files: |
|
|
${{ steps.create_zip.outputs.filename}}
|