Skip to content
This repository was archived by the owner on Jan 11, 2024. It is now read-only.

Commit dd7af12

Browse files
committed
ci: add option to provide release version on manual trigger
1 parent 0a719fe commit dd7af12

File tree

4 files changed

+79
-3
lines changed

4 files changed

+79
-3
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
const semver = require('semver');
2+
const core = require('@actions/core');
3+
4+
exports.preVersionGeneration = (version) => {
5+
const { VERSION } = process.env;
6+
core.info(`Computed version bump: ${version}`);
7+
8+
const newVersion = semver.valid(VERSION);
9+
if (newVersion && semver.gte(newVersion, version)) {
10+
version = newVersion;
11+
core.info(`Using provided version: ${version}`);
12+
}
13+
return version;
14+
}
15+
16+
exports.preTagGeneration = (tag) => { }

.github/workflows/main.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ on:
1515
description: Create release
1616
required: false
1717
type: boolean
18+
version:
19+
description: New version to release
20+
required: false
21+
type: string
1822

1923
env:
2024
RUBY_VER: 2.7
@@ -185,6 +189,9 @@ jobs:
185189
fallback-version: '1.0.0'
186190
config-file-path: '.github/config/config.js'
187191
pre-commit: '.github/config/pre_commit_hook.js'
192+
pre-changelog-generation: '.github/config/pre_changelog_hook.js'
193+
env:
194+
VERSION: ${{ github.event.inputs.version }}
188195

189196
- name: Build package products and documentation
190197
if: steps.conventional_changelog.outputs.skipped == 'false'

package-lock.json

Lines changed: 53 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
"archiver": "^5.3.1",
2121
"conventional-changelog-conventionalcommits": "^4.6.3",
2222
"open": "^8.4.0",
23-
"plist": "^3.0.5"
23+
"plist": "^3.0.5",
24+
"semver": "^7.3.7"
2425
},
2526
"scripts": {
2627
"build": "Scripts/build.js",
@@ -32,4 +33,4 @@
3233
"build-doc": "Scripts/build-doc.js",
3334
"serve-doc": "Scripts/serve-doc.js"
3435
}
35-
}
36+
}

0 commit comments

Comments
 (0)