Skip to content

Commit

Permalink
Setup release-it (#8)
Browse files Browse the repository at this point in the history
Automated release workflow
  • Loading branch information
kurgm authored Oct 27, 2024
2 parents 66f8610 + 58c6f27 commit dae6dcb
Show file tree
Hide file tree
Showing 5 changed files with 3,111 additions and 119 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Release

on:
workflow_dispatch:
inputs:
version:
description: "Version to release"
required: true

jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
environment: release
steps:
- uses: actions/checkout@v4
with:
ref: master
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
registry-url: https://registry.npmjs.org
cache: "npm"
- run: npm ci
- name: Configure Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Release
run: npx release-it -- "${RELEASE_VERSION}" --ci
env:
TZ: Asia/Tokyo
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
RELEASE_VERSION: ${{ github.event.inputs.version }}
30 changes: 30 additions & 0 deletions .release-it.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"$schema": "https://unpkg.com/release-it@17/schema/release-it.json",
"hooks": {
},
"plugins": {
"@release-it/keep-a-changelog": {
"filename": "CHANGELOG.md",
"addUnreleased": true,
"addVersionUrl": true
},
"@release-it/bumper": {
"out": {
"file": "README.md",
"type": "text/plain"
}
}
},
"npm": {
"publishArgs": ["--provenance"]
},
"git": {
"tagName": "v${version}",
"commitMessage": "${version}",
"requireBranch": "master"
},
"github": {
"release": true,
"releaseName": "v${version}"
}
}
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
## [0.2.0] - 2020-06-05


[Unreleased]: https://github.com/kurgm/kage-engine/compare/v0.5.0...master
[Unreleased]: https://github.com/kurgm/kage-engine/compare/v0.5.0...HEAD
[0.5.0]: https://github.com/kurgm/kage-engine/compare/v0.4.0...v0.5.0
[0.4.0]: https://github.com/kurgm/kage-engine/compare/v0.3.1...v0.4.0
[0.3.1]: https://github.com/kurgm/kage-engine/compare/v0.3.0...v0.3.1
Expand Down
Loading

0 comments on commit dae6dcb

Please sign in to comment.