-
Notifications
You must be signed in to change notification settings - Fork 4
50 lines (47 loc) · 1.68 KB
/
build-latest-dev.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Release Latest Dev Build
# masterブランチが更新されるたびに開発版をビルドしてデプロイする。
# バージョン(タグ)は最新リリースのバージョンを`X.Y.Z`としたときの`X.Y+1.0-dev`。
on:
push:
branches:
- master
paths-ignore:
- "docs/**"
- "test/**"
workflow_dispatch:
jobs:
latest-dev-build:
runs-on: ubuntu-latest
if: github.repository_owner == 'Aivis-Project'
steps:
- name: Trigger workflow_dispatch
uses: actions/github-script@v7
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-engine-package.yml',
ref: 'master',
inputs: {
version: dev_version,
prerelease: true
}
})
github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'build-engine-container.yml',
ref: 'master',
inputs: {
version: dev_version
}
})
console.log(`Triggered workflow_dispatch for ${dev_version}`);