{"id":13828928,"url":"https://github.com/technote-space/release-github-actions","last_synced_at":"2025-08-20T04:32:48.258Z","repository":{"id":38191761,"uuid":"204282360","full_name":"technote-space/release-github-actions","owner":"technote-space","description":"GitHub Actions to automate the release of GitHub Actions","archived":false,"fork":false,"pushed_at":"2023-12-30T03:01:18.000Z","size":23525,"stargazers_count":80,"open_issues_count":5,"forks_count":14,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-06T07:02:57.618Z","etag":null,"topics":["github-actions","release"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/technote-space.png","metadata":{"files":{"readme":"README.ja.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"custom":"https://paypal.me/technote0space"}},"created_at":"2019-08-25T11:01:25.000Z","updated_at":"2024-03-19T13:59:52.000Z","dependencies_parsed_at":"2023-01-11T17:21:28.439Z","dependency_job_id":"8bb261fe-7d62-4958-907b-9a4c22b22683","html_url":"https://github.com/technote-space/release-github-actions","commit_stats":{"total_commits":1084,"total_committers":5,"mean_commits":216.8,"dds":0.466789667896679,"last_synced_commit":"266602b2dece0d0a929e37bb672b8f489196879c"},"previous_names":[],"tags_count":355,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technote-space%2Frelease-github-actions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technote-space%2Frelease-github-actions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technote-space%2Frelease-github-actions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technote-space%2Frelease-github-actions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/technote-space","download_url":"https://codeload.github.com/technote-space/release-github-actions/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230057986,"owners_count":18166178,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github-actions","release"],"created_at":"2024-08-04T09:03:20.965Z","updated_at":"2024-12-19T07:07:01.599Z","avatar_url":"https://github.com/technote-space.png","language":"TypeScript","funding_links":["https://paypal.me/technote0space"],"categories":["TypeScript"],"sub_categories":[],"readme":"# Release GitHub Actions\n\n[![CI Status](https://github.com/technote-space/release-github-actions/workflows/CI/badge.svg)](https://github.com/technote-space/release-github-actions/actions)\n[![codecov](https://codecov.io/gh/technote-space/release-github-actions/branch/main/graph/badge.svg)](https://codecov.io/gh/technote-space/release-github-actions)\n[![CodeFactor](https://www.codefactor.io/repository/github/technote-space/release-github-actions/badge)](https://www.codefactor.io/repository/github/technote-space/release-github-actions)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/technote-space/release-github-actions/blob/main/LICENSE)\n\n*Read this in other languages: [English](README.md), [日本語](README.ja.md).*\n\nこれは `GitHub Actions` のリリースを自動化するための `GitHub Actions` です。  \nタグを作成するとこのアクションは自動で以下を行います。\n1. ビルド実行\n1. リリース用ブランチ作成\n1. リリース用ブランチに[タグ](#tags)を張り替え\n1. 同じタグ名 かつ 公開済みのリリースが存在する場合、再度公開 (タグを張り替えた場合、リリースが下書き状態になるため)\n\n## Table of Contents\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n\u003cdetails\u003e\n\u003csummary\u003eDetails\u003c/summary\u003e\n\n- [使用方法](#%E4%BD%BF%E7%94%A8%E6%96%B9%E6%B3%95)\n- [CLI ツール](#cli-%E3%83%84%E3%83%BC%E3%83%AB)\n- [スクリーンショット](#%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88)\n- [オプション](#%E3%82%AA%E3%83%97%E3%82%B7%E3%83%A7%E3%83%B3)\n- [Execute commands](#execute-commands)\n  - [ビルド](#%E3%83%93%E3%83%AB%E3%83%89)\n  - [ファイル削除](#%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E5%89%8A%E9%99%A4)\n- [Action イベント詳細](#action-%E3%82%A4%E3%83%99%E3%83%B3%E3%83%88%E8%A9%B3%E7%B4%B0)\n  - [対象イベント](#%E5%AF%BE%E8%B1%A1%E3%82%A4%E3%83%99%E3%83%B3%E3%83%88)\n  - [condition](#condition)\n- [動機](#%E5%8B%95%E6%A9%9F)\n- [補足](#%E8%A3%9C%E8%B6%B3)\n  - [Tags](#tags)\n- [Author](#author)\n\n*generated with [TOC Generator](https://github.com/technote-space/toc-generator)*\n\n\u003c/details\u003e\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n## 使用方法\n例：`.github/workflows/release.yml`  \n```yaml\n#on:\n#  push:\n#    tags:\n#      - \"v*\"\n\non: create\n\nname: Release\njobs:\n  release:\n    name: Release GitHub Actions\n    runs-on: ubuntu-latest\n    steps:\n      - uses: technote-space/release-github-actions@v6\n```\n\n[対象イベントの詳細](#action-%E3%82%A4%E3%83%99%E3%83%B3%E3%83%88%E8%A9%B3%E7%B4%B0)\n\n## CLI ツール\n[![technote-space/release-github-actions-cli - GitHub](https://gh-card.dev/repos/technote-space/release-github-actions-cli.svg)](https://github.com/technote-space/release-github-actions-cli)\n\n## スクリーンショット\n![Release](https://raw.githubusercontent.com/technote-space/release-github-actions/images/screenshot-7.gif)\n\n## オプション\n| name | description | default | required | e.g. |\n|:---:|:---|:---:|:---:|:---:|\n| BUILD_COMMAND | ビルド用コマンド\u003cbr\u003e[コマンドの詳細](#execute-commands) | | | `yarn build:all` |\n| CLEAN_TARGETS | リリース前に掃除するファイルやディレクトリ (カンマ区切り)\u003cbr\u003e絶対パスや `..` は使用できません\u003cbr\u003e[コマンドの詳細](#execute-commands) |`.[!.]*,__tests__,docs,src,*.[jt]s,*.[mc][jt]s,*.json,*.lock,*.yml,*.yaml` | true | `.[!.]*,*.txt` |\n| PACKAGE_MANAGER | 依存関係のインストールに使用するパッケージマネージャー\u003cbr\u003e`yarn.lock` や `package-lock.json` がある場合は自動で使用するパッケージマネージャーを決定しますが、このオプションで強制することができます\u003cbr\u003e（`npm` または `yarn`） | | | `yarn` |\n| COMMIT_MESSAGE | コミット時に設定するメッセージ | `feat: build for release` | true | `feat: release` |\n| COMMIT_NAME | コミット時に設定する名前 | `github-actions[bot]` | true | |\n| COMMIT_EMAIL | コミット時に設定する名前 | `41898282+github-actions[bot]@users.noreply.github.com` | true | |\n| BRANCH_NAME | GitHub Actions 用のブランチ名 | `gh-actions` | true | `gh-actions/${MAJOR}/${MINOR}/${PATCH}` |\n| BUILD_COMMAND_TARGET | ビルド用コマンド検索ターゲット | `prepare, build, production, prod, package, pack` | | `compile` |\n| ALLOW_MULTIPLE_BUILD_COMMANDS | 複数のビルドコマンド実行を許可するかどうか | `true` | | `false` |\n| CREATE_MAJOR_VERSION_TAG | メジャーバージョンタグ(例：v1)を作成するかどうか\u003cbr\u003e[タグの詳細](#tags) | `true` | | `false` |\n| CREATE_MINOR_VERSION_TAG | マイナーバージョンタグ(例：v1.2)を作成するかどうか\u003cbr\u003e[タグの詳細](#tags) | `true` | | `false` |\n| CREATE_PATCH_VERSION_TAG | パッチバージョンタグ(例：v1.2.3)を作成するかどうか\u003cbr\u003e[タグの詳細](#tags) | `true` | | `false` |\n| FETCH_DEPTH | 取得するコミット履歴の制限数 | `3` | | `5` |\n| TEST_TAG_PREFIX | テスト用タグのプリフィックス | | | `test/` |\n| CLEAN_TEST_TAG | テストタグを掃除するかどうか | `false` | | `true` |\n| ORIGINAL_TAG_PREFIX | 元のタグを残す際に付与するプリフィックス | | | `original/` |\n| DELETE_NODE_MODULES | node_modules を削除するかどうか | `false` | | `true` |\n| GITHUB_TOKEN | アクセストークン | `${{github.token}}` | true | `${{secrets.ACCESS_TOKEN}}` |\n\n## Execute commands\n### ビルド\n- `prepare`、 `build`、 `production`、 `prod`、 `package` または `pack` が package.json の scripts に含まれる場合、ビルド用のコマンドとしてそれらを使用します。([BUILD_COMMAND_TARGET](#%E3%82%AA%E3%83%97%E3%82%B7%E3%83%A7%E3%83%B3) で変更可能です)  \n- `npm run install` や `yarn install` のようなインストール用コマンドが存在しない場合、インストール用コマンドが追加されます。  \n\nしたがって、`BUILD_COMMAND` が設定されていない かつ package.json に `build` が存在する場合、以下のコマンドが実行されます。\n\n```shell\nyarn install\nyarn build\nyarn install --production\n```\n\n`build` と `pack` が含まれる場合は、以下のコマンドになります。\n                            \n```shell\nyarn install\nyarn build\nyarn pack\nyarn install --production\n```\n\n### ファイル削除\n`GitHub Actions` の実行には「ビルドに使用するソース」や「テストファイル」、「テストの設定」などを必要としません。  \nそして `GitHub Actions` は使用されるたびにダウンロードされるため、ファイルは少ないほうが良いです。  \n\n`CLEAN_TARGETS` オプションはこの目的のために使用されます。  \ndefault: `.[!.]*,__tests__,docs,src,*.[jt]s,*.[mc][jt]s,*.json,*.lock,*.yml,*.yaml`  \n\n```shell\nrm -rdf .[!.]*\nrm -rdf *.js\nrm -rdf *.mjs\nrm -rdf *.ts\nrm -rdf *.cts\nrm -rdf *.json\nrm -rdf *.lock\nrm -rdf *.yml\nrm -rdf *.yaml\nrm -rdf __tests__ docs src\n```\n\n(action.yml は削除の対象ではありません)\n\n## Action イベント詳細\n### 対象イベント\n| eventName: action | condition |\n|:---:|:---:|\n|push: *|[condition](#condition)|\n|release: published|[condition](#condition)|\n|create: *|[condition](#condition)|\n\n### condition\n- tags\n  - semantic versioning tag (例：`v1.2.3`)\n  - [テストタグ](#%E3%82%AA%E3%83%97%E3%82%B7%E3%83%A7%E3%83%B3) (例：`test/v1.2.3`)\n\n## 動機\n`GitHub Actions`をリリースするには、すべてのビルドファイルと `node_modules` のような依存関係が必要ですが、通常はそれらをコミットしません。  \nしたがって`GitHub Actions`リリースする際には以下のような手順が必要です。  \n1. ローカルの開発用ブランチで開発\n1. リリース用にビルド\n1. `node_modules` のような依存モジュールを含めて必要なソースをリリース用ブランチにコミット\n1. タグを付与 (メジャー、マイナー、パッチバージョンの考慮が必要)\n1. GitHub にプッシュ\n1. リリースを作成\n\nリリースの度にこれらの手順を実行するのはとても面倒です。  \n\nこの `GitHub Actions` を使用することで手順は単純になります。\n1. ローカルの開発用ブランチで開発\n1. リリースを作成 (タグを作成)\n1. 自動化された手順が完了するのを待つ\n   1. リリース用にビルド\n   1. `node_modules` のような依存モジュールを含めて必要なソースをリリース用ブランチにコミット\n   1. タグを付与 (メジャー、マイナー、パッチバージョンの考慮が必要)\n   1. GitHub にプッシュ\n\n## 補足\n### Tags\nタグ名は [Semantic Versioning](https://semver.org/) に従っている必要があります。  \n以下のタグが作成されます。\n- 指定されたタグ名\n- メジャーバージョンのタグ名 (指定されたタグ名から生成)\n  - 例：`v1`\n- マイナーバージョンのタグ名 (指定されたタグ名から生成)\n  - 例：`v1.2`\n- パッチバージョンのタグ名 (指定されたタグ名から生成)\n  - 例：`v1.2.3`\n\n## Author\n[GitHub (Technote)](https://github.com/technote-space)  \n[Blog](https://technote.space)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechnote-space%2Frelease-github-actions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechnote-space%2Frelease-github-actions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechnote-space%2Frelease-github-actions/lists"}