Skip to content

Commit

Permalink
mainブランチ更新時に最新版が-devにリリースされるようにする (#771)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiroshiba authored Nov 20, 2023
1 parent 1bfa91b commit 86e02f2
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ on:
code_signing:
description: "コード署名する"
type: boolean
default: false
upload_artifact:
description: "デバッグ用に成果物をartifactにアップロードするか"
type: boolean
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/release_latest_dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Release latest dev build

# masterブランチが更新されるたびに開発版をビルドしてデプロイする。
# バージョン(タグ)は最新リリースのバージョンを`X.Y.Z`としたときの`X.Y+1.0-dev`。

on:
push:
branches:
- master
paths-ignore:
- "docs/**"
- "test/**"

jobs:
latest-dev-build:
runs-on: ubuntu-latest
if: github.repository_owner == 'VOICEVOX'
steps:
- name: Trigger workflow_dispatch
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const latest_release = await github.rest.repos.getLatestRelease({
owner: context.repo.owner,
repo: context.repo.repo
});
const split_version = latest_release.data.tag_name.split('.');
const dev_version = `${split_version[0]}.${parseInt(split_version[1]) + 1}.0-dev`;
github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'build.yml',
ref: 'master',
inputs: {
version: dev_version,
prerelease: true
}
})
github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'build-docker.yml',
ref: 'master',
inputs: {
version: dev_version
}
})
console.log(`Triggered workflow_dispatch for ${dev_version}`);

0 comments on commit 86e02f2

Please sign in to comment.