Skip to content

Commit 20cf460

Browse files
committed
Версия ovm выведена в inputs
1 parent cdf1813 commit 20cf460

4 files changed

Lines changed: 22 additions & 3 deletions

File tree

.github/workflows/check.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ jobs:
1010
matrix:
1111
oscript_version: [lts, stable, dev]
1212
os: [macOS-latest, ubuntu-latest, windows-latest]
13+
ovm_version: ['1.2.1', latest]
1314
name: check oscript
14-
steps:
15+
steps:
1516
- uses: actions/checkout@v2
1617
- uses: ./
1718
with:
1819
version: ${{ matrix.oscript_version }}
20+
ovm_version: ${{ matrix.ovm_version }}
1921
- name: Проверка скрипта OS
2022
run: oscript test/fixtures/test.os
2123
- name: Проверка установки coverage

action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ author: 'otymko'
77
inputs:
88
version:
99
description: 'Version of Onescript to use. Support value: 1.3.0, 1.5.0, 1.8.1, dev'
10+
required: true
11+
ovm_version:
12+
description: 'Version of Onescript manager to use. Support value: 1.1.0, 1.2.0, latest'
13+
required: false
14+
default: 'latest'
1015
runs:
1116
using: 'node12'
1217
main: 'dist/index.js'

dist/index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8657,6 +8657,7 @@ async function run() {
86578657
try {
86588658

86598659
const osVersion = core.getInput('version');
8660+
const ovmVersion = core.getInput('ovm_version');
86608661

86618662
console.log('OS: ' + platform);
86628663

@@ -8672,7 +8673,12 @@ async function run() {
86728673
if (platform == 'win32') {
86738674
pathToOVM = path.dirname(__dirname) + '/' + 'ovm.exe';
86748675
}
8675-
await exec.exec('curl -L https://github.com/oscript-library/ovm/releases/download/v1.2.0/ovm.exe --output ' + pathToOVM);
8676+
8677+
if (ovmVersion == 'latest') {
8678+
await exec.exec('curl -L https://github.com/oscript-library/ovm/releases/latest/download/ovm.exe --output ' + pathToOVM);
8679+
} else {
8680+
await exec.exec('curl -L https://github.com/oscript-library/ovm/releases/download/v'+ ovmVersion + '/ovm.exe --output ' + pathToOVM);
8681+
}
86768682

86778683
if (platform == 'win32') {
86788684
let pathToOVM = path.dirname(__dirname);

index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ async function run() {
1111
try {
1212

1313
const osVersion = core.getInput('version');
14+
const ovmVersion = core.getInput('ovm_version');
1415

1516
console.log('OS: ' + platform);
1617

@@ -26,7 +27,12 @@ async function run() {
2627
if (platform == 'win32') {
2728
pathToOVM = path.dirname(__dirname) + '/' + 'ovm.exe';
2829
}
29-
await exec.exec('curl -L https://github.com/oscript-library/ovm/releases/download/v1.2.0/ovm.exe --output ' + pathToOVM);
30+
31+
if (ovmVersion == 'latest') {
32+
await exec.exec('curl -L https://github.com/oscript-library/ovm/releases/latest/download/ovm.exe --output ' + pathToOVM);
33+
} else {
34+
await exec.exec('curl -L https://github.com/oscript-library/ovm/releases/download/v'+ ovmVersion + '/ovm.exe --output ' + pathToOVM);
35+
}
3036

3137
if (platform == 'win32') {
3238
let pathToOVM = path.dirname(__dirname);

0 commit comments

Comments
 (0)