-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from tshion/develop
Publish 2025.01.02
- Loading branch information
Showing
25 changed files
with
4,054 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# http://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_size = 2 | ||
indent_style = space | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
build/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "./node_modules/gts/" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: 'github-actions' | ||
directory: '/' | ||
schedule: | ||
interval: 'weekly' | ||
day: 'tuesday' | ||
assignees: | ||
- 'tshion' | ||
|
||
- package-ecosystem: 'npm' | ||
directory: '/' | ||
schedule: | ||
interval: 'weekly' | ||
day: 'tuesday' | ||
assignees: | ||
- 'tshion' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
# 引数で指定されたGit タグ名でリリースできるかどうか | ||
# | ||
# $1 -> Git タグ名 | ||
# | ||
# 注意事項 | ||
# * GitHub CLI のアクセス権限設定が必要 | ||
|
||
if gh release view $1 --repo tshion/gapi-utils-nodejs > /dev/null; then | ||
echo "$1 is already released!" | ||
exit 1 | ||
fi |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
|
||
# まだリリースしていないGit タグのリリースノートの推定 | ||
# ※GitHub CLI のアクセス権限等の設定が必要 | ||
# | ||
# $1 -> リリースしようとしているGit タグ名 | ||
# $2 -> $1 があるGit ブランチ名 | ||
|
||
repoName="tshion/gapi-utils-nodejs" | ||
|
||
latestTag=$(gh release list \ | ||
--exclude-drafts \ | ||
--exclude-pre-releases \ | ||
--order desc --limit 1 \ | ||
--json tagName --jq '.[].tagName' \ | ||
) | ||
|
||
gh api \ | ||
--method POST \ | ||
-H "Accept: application/vnd.github+json" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
"/repos/$repoName/releases/generate-notes" \ | ||
-f "tag_name=preview$1" \ | ||
-f "target_commitish=$2" \ | ||
-f "previous_tag_name=$latestTag" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
name: Create a pull request for set version | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
create: | ||
if: ${{ github.ref_type == 'branch' && github.ref_name == 'develop' }} | ||
runs-on: ubuntu-24.04 | ||
timeout-minutes: 5 | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
steps: | ||
# https://github.com/actions/checkout | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Decide version | ||
id: meta | ||
run: | | ||
version=$(date +%Y.%m.%d) | ||
echo "version=$version" >> "$GITHUB_OUTPUT" | ||
- name: Can release | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
TAG: ${{ steps.meta.outputs.version }} | ||
run: bash .github/scripts/can-release.bash "$TAG" | ||
|
||
# https://github.com/actions/setup-node | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: .node-version | ||
cache: npm | ||
cache-dependency-path: ./package-lock.json | ||
|
||
- name: Set version | ||
env: | ||
VERSION: ${{ steps.meta.outputs.version }} | ||
run: npm version "$VERSION" --allow-same-version --no-git-tag-version | ||
|
||
- run: npm ci | ||
|
||
- run: npm run compile | ||
|
||
- name: Generate diff notes | ||
id: notes | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
REF_NAME: ${{ github.ref_name }} | ||
TAG: ${{ steps.meta.outputs.version }} | ||
run: | | ||
response=$(bash .github/scripts/presume-release-notes.bash "$TAG" "$REF_NAME") | ||
echo "response=$response" >> "$GITHUB_OUTPUT" | ||
echo "$response" | ||
# https://github.com/tshion/apply-git-user | ||
- uses: tshion/[email protected] | ||
with: | ||
user: github-actions | ||
|
||
- name: git add & push | ||
env: | ||
VERSION: ${{ steps.meta.outputs.version }} | ||
run: | | ||
branch="feature/$VERSION" | ||
message="Update $VERSION" | ||
git switch --create "$branch" | ||
git add build | ||
git add package.json | ||
git add package-lock.json | ||
git commit --message "$message" | ||
git push --set-upstream origin "$branch" | ||
- name: Create pull request | ||
env: | ||
ASSIGNEE: tshion | ||
BASE: ${{ github.ref_name }} | ||
BODY: ${{ fromJson(steps.notes.outputs.response).body }} | ||
GH_TOKEN: ${{ github.token }} | ||
TITLE: '${{ steps.meta.outputs.version }}' | ||
run: gh pr create --assignee "$ASSIGNEE" --base "$BASE" --title "$TITLE" --body "$BODY" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Prepare a GitHub release note | ||
|
||
on: | ||
push: | ||
branches: | ||
- released | ||
|
||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
preparation: | ||
if: ${{ github.ref_type == 'branch' }} | ||
runs-on: ubuntu-24.04 | ||
timeout-minutes: 5 | ||
permissions: | ||
contents: write | ||
steps: | ||
# https://github.com/actions/checkout | ||
- uses: actions/checkout@v4 | ||
|
||
# https://github.com/actions/setup-node | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: .node-version | ||
cache: npm | ||
cache-dependency-path: ./package-lock.json | ||
|
||
- name: Get version name | ||
id: meta | ||
run: | | ||
version=$(node -p "require('./package.json').version") | ||
echo "version=$version" >> "$GITHUB_OUTPUT" | ||
- name: Create draft release notes | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
VERSION: ${{ steps.meta.outputs.version }} | ||
run: | | ||
git tag "$VERSION" | ||
git push origin "$VERSION" | ||
gh release create "$VERSION" --draft --generate-notes --title "$VERSION" |
Oops, something went wrong.