Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
59a5481c7d | ||
|
|
4686a99fc5 | ||
|
|
2f01469b02 | ||
|
|
f6d2e5de5d | ||
|
|
f5fec4dcb7 | ||
|
|
37e2edb15e | ||
|
|
c64fa18722 | ||
|
|
a3bd2fdf17 | ||
|
|
a7e6ec0df9 | ||
|
|
23835ee500 | ||
|
|
84b5c35087 | ||
|
|
365543a8d9 | ||
|
|
49d7a2a9ae | ||
|
|
409aab1aac | ||
|
|
f0c3acec24 | ||
|
|
399a47813e | ||
|
|
87ca224aa8 | ||
|
|
a1905c800f | ||
|
|
14cf1a3f11 | ||
|
|
858d2d954a | ||
|
|
5c3d315241 |
74
.github/workflows/workflow.yml
vendored
74
.github/workflows/workflow.yml
vendored
@@ -1,22 +1,74 @@
|
|||||||
name: Main workflow
|
name: Main workflow
|
||||||
on: [push]
|
on: [push]
|
||||||
jobs:
|
jobs:
|
||||||
run:
|
test_channel:
|
||||||
name: Run
|
|
||||||
runs-on: ${{ matrix.operating-system }}
|
runs-on: ${{ matrix.operating-system }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
operating-system: [ubuntu-latest, windows-latest, macos-latest]
|
operating-system: [ubuntu-latest, windows-latest, macos-latest]
|
||||||
|
channel: [stable, beta, dev]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
- name: Set Node.js 10.x
|
- uses: ./
|
||||||
uses: actions/setup-node@v1
|
|
||||||
with:
|
with:
|
||||||
node-version: 10.x
|
channel: ${{ matrix.channel }}
|
||||||
- name: npm install
|
- name: Print FLUTTER_ROOT
|
||||||
run: npm install
|
shell: bash
|
||||||
- name: Lint
|
run: echo "FLUTTER_ROOT set to $FLUTTER_ROOT"
|
||||||
run: npm run format-check
|
- name: Print PUB_CACHE
|
||||||
- name: npm test
|
shell: bash
|
||||||
run: npm test
|
run: echo "PUB_CACHE set to $PUB_CACHE"
|
||||||
|
- name: Run dart --version
|
||||||
|
shell: bash
|
||||||
|
run: dart --version
|
||||||
|
- name: Run flutter --version
|
||||||
|
shell: bash
|
||||||
|
run: flutter --version
|
||||||
|
test_version:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
version: [ 2.5.3, 2.x, 1, v1.12 ]
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- uses: ./
|
||||||
|
with:
|
||||||
|
channel: stable
|
||||||
|
flutter-version: ${{ matrix.version }}
|
||||||
|
- name: Run dart --version
|
||||||
|
shell: bash
|
||||||
|
run: dart --version
|
||||||
|
- name: Run flutter --version
|
||||||
|
shell: bash
|
||||||
|
run: flutter --version
|
||||||
|
test_master_channel:
|
||||||
|
runs-on: windows-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- uses: ./
|
||||||
|
with:
|
||||||
|
channel: master
|
||||||
|
- name: Run dart --version
|
||||||
|
shell: bash
|
||||||
|
run: dart --version
|
||||||
|
- name: Run flutter --version
|
||||||
|
shell: bash
|
||||||
|
run: flutter --version
|
||||||
|
test_any_channel:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- uses: ./
|
||||||
|
with:
|
||||||
|
channel: any
|
||||||
|
flutter-version: 2
|
||||||
|
- name: Run dart --version
|
||||||
|
shell: bash
|
||||||
|
run: dart --version
|
||||||
|
- name: Run flutter --version
|
||||||
|
shell: bash
|
||||||
|
run: flutter --version
|
||||||
|
|||||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,3 +0,0 @@
|
|||||||
node_modules/
|
|
||||||
lib/
|
|
||||||
__tests__/runner/*
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
{
|
|
||||||
"printWidth": 80,
|
|
||||||
"tabWidth": 2,
|
|
||||||
"useTabs": false,
|
|
||||||
"semi": true,
|
|
||||||
"singleQuote": true,
|
|
||||||
"trailingComma": "none",
|
|
||||||
"bracketSpacing": false,
|
|
||||||
"arrowParens": "avoid",
|
|
||||||
"parser": "typescript"
|
|
||||||
}
|
|
||||||
85
README.md
85
README.md
@@ -4,17 +4,16 @@ This action sets up a flutter environment for use in actions. It works on Linux,
|
|||||||
|
|
||||||
# Usage
|
# Usage
|
||||||
|
|
||||||
|
Use specific version and channel:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-java@v1
|
- uses: subosito/flutter-action@v2
|
||||||
with:
|
with:
|
||||||
java-version: '12.x'
|
flutter-version: '2.8.0'
|
||||||
- uses: subosito/flutter-action@v1
|
channel: 'stable'
|
||||||
with:
|
- run: flutter --version
|
||||||
flutter-version: '2.0.5'
|
|
||||||
- run: flutter pub get
|
|
||||||
- run: flutter test
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Use latest release for particular channel:
|
Use latest release for particular channel:
|
||||||
@@ -22,15 +21,10 @@ Use latest release for particular channel:
|
|||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-java@v1
|
- uses: subosito/flutter-action@v2
|
||||||
with:
|
|
||||||
java-version: '12.x'
|
|
||||||
- uses: subosito/flutter-action@v1
|
|
||||||
with:
|
with:
|
||||||
channel: 'stable' # or: 'beta', 'dev' or 'master'
|
channel: 'stable' # or: 'beta', 'dev' or 'master'
|
||||||
- run: flutter pub get
|
- run: flutter --version
|
||||||
- run: flutter test
|
|
||||||
- run: flutter build apk
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Use latest release for particular version and/or channel:
|
Use latest release for particular version and/or channel:
|
||||||
@@ -38,15 +32,11 @@ Use latest release for particular version and/or channel:
|
|||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-java@v1
|
- uses: subosito/flutter-action@v2
|
||||||
with:
|
|
||||||
java-version: '12.x'
|
|
||||||
- uses: subosito/flutter-action@v1
|
|
||||||
with:
|
with:
|
||||||
flutter-version: '1.22.x' # or, you can use 1.22
|
flutter-version: '1.22.x' # or, you can use 1.22
|
||||||
channel: 'dev'
|
channel: 'dev'
|
||||||
- run: flutter pub get
|
- run: flutter --version
|
||||||
- run: flutter test
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Use particular version on any channel:
|
Use particular version on any channel:
|
||||||
@@ -54,15 +44,11 @@ Use particular version on any channel:
|
|||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-java@v1
|
- uses: subosito/flutter-action@v2
|
||||||
with:
|
|
||||||
java-version: '12.x'
|
|
||||||
- uses: subosito/flutter-action@v1
|
|
||||||
with:
|
with:
|
||||||
flutter-version: '2.x'
|
flutter-version: '2.x'
|
||||||
channel: 'any'
|
channel: 'any'
|
||||||
- run: flutter pub get
|
- run: flutter --version
|
||||||
- run: flutter test
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Build Android APK and app bundle:
|
Build Android APK and app bundle:
|
||||||
@@ -70,19 +56,20 @@ Build Android APK and app bundle:
|
|||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-java@v1
|
- uses: actions/setup-java@v2
|
||||||
with:
|
with:
|
||||||
java-version: '12.x'
|
distribution: 'zulu'
|
||||||
- uses: subosito/flutter-action@v1
|
java-version: '11'
|
||||||
|
- uses: subosito/flutter-action@v2
|
||||||
with:
|
with:
|
||||||
flutter-version: '2.0.5'
|
flutter-version: '2.5.3'
|
||||||
- run: flutter pub get
|
- run: flutter pub get
|
||||||
- run: flutter test
|
- run: flutter test
|
||||||
- run: flutter build apk
|
- run: flutter build apk
|
||||||
- run: flutter build appbundle
|
- run: flutter build appbundle
|
||||||
```
|
```
|
||||||
|
|
||||||
Build for iOS too (macOS only):
|
Build for iOS (macOS only):
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
jobs:
|
jobs:
|
||||||
@@ -90,15 +77,11 @@ jobs:
|
|||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-java@v1
|
- uses: subosito/flutter-action@v2
|
||||||
with:
|
with:
|
||||||
java-version: '12.x'
|
flutter-version: '2.5.3'
|
||||||
- uses: subosito/flutter-action@v1
|
|
||||||
with:
|
|
||||||
flutter-version: '2.0.5'
|
|
||||||
- run: flutter pub get
|
- run: flutter pub get
|
||||||
- run: flutter test
|
- run: flutter test
|
||||||
- run: flutter build apk
|
|
||||||
- run: flutter build ios --release --no-codesign
|
- run: flutter build ios --release --no-codesign
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -107,9 +90,9 @@ Build for the web:
|
|||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: subosito/flutter-action@v1
|
- uses: subosito/flutter-action@v2
|
||||||
with:
|
with:
|
||||||
flutter-version: '2.0.5'
|
flutter-version: '2.5.3'
|
||||||
- run: flutter pub get
|
- run: flutter pub get
|
||||||
- run: flutter test
|
- run: flutter test
|
||||||
- run: flutter build web
|
- run: flutter build web
|
||||||
@@ -118,15 +101,16 @@ steps:
|
|||||||
Build for Windows:
|
Build for Windows:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
windows:
|
jobs:
|
||||||
runs-on: windows-latest
|
build:
|
||||||
steps:
|
runs-on: windows-latest
|
||||||
- uses: actions/checkout@v2
|
steps:
|
||||||
- uses: subosito/flutter-action@v1
|
- uses: actions/checkout@v2
|
||||||
with:
|
- uses: subosito/flutter-action@v2
|
||||||
channel: beta
|
with:
|
||||||
- run: flutter config --enable-windows-desktop
|
channel: beta
|
||||||
- run: flutter build windows
|
- run: flutter config --enable-windows-desktop
|
||||||
|
- run: flutter build windows
|
||||||
```
|
```
|
||||||
|
|
||||||
Matrix Testing:
|
Matrix Testing:
|
||||||
@@ -141,10 +125,7 @@ jobs:
|
|||||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-java@v1
|
- uses: subosito/flutter-action@v2
|
||||||
with:
|
|
||||||
java-version: '12.x'
|
|
||||||
- uses: subosito/flutter-action@v1
|
|
||||||
with:
|
with:
|
||||||
flutter-version: '1.20.2'
|
flutter-version: '1.20.2'
|
||||||
channel: 'beta'
|
channel: 'beta'
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,76 +0,0 @@
|
|||||||
import io = require('@actions/io');
|
|
||||||
import exec = require('@actions/exec');
|
|
||||||
import fs = require('fs');
|
|
||||||
import path = require('path');
|
|
||||||
import nock = require('nock');
|
|
||||||
|
|
||||||
const toolDir = path.join(__dirname, 'runner', 'tools');
|
|
||||||
const tempDir = path.join(__dirname, 'runner', 'temp');
|
|
||||||
const dataDir = path.join(__dirname, 'data');
|
|
||||||
|
|
||||||
process.env['RUNNER_TOOL_CACHE'] = toolDir;
|
|
||||||
process.env['RUNNER_TEMP'] = tempDir;
|
|
||||||
|
|
||||||
import * as installer from '../src/installer';
|
|
||||||
import * as release from '../src/release';
|
|
||||||
|
|
||||||
describe('installer tests', () => {
|
|
||||||
beforeAll(async () => {
|
|
||||||
await io.rmRF(toolDir);
|
|
||||||
await io.rmRF(tempDir);
|
|
||||||
}, 100000);
|
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
const platform = release.getPlatform();
|
|
||||||
nock('https://storage.googleapis.com', {allowUnmocked: true})
|
|
||||||
.get(`/flutter_infra_release/releases/releases_${platform}.json`)
|
|
||||||
.replyWithFile(200, path.join(dataDir, `releases_${platform}.json`));
|
|
||||||
});
|
|
||||||
|
|
||||||
afterEach(async () => {
|
|
||||||
nock.cleanAll();
|
|
||||||
nock.enableNetConnect();
|
|
||||||
|
|
||||||
await io.rmRF(toolDir);
|
|
||||||
await io.rmRF(tempDir);
|
|
||||||
}, 100000);
|
|
||||||
|
|
||||||
it('Downloads flutter', async () => {
|
|
||||||
await installer.getFlutter('2.0.0', 'stable');
|
|
||||||
const sdkDir = path.join(toolDir, 'flutter', '2.0.0-stable', 'x64');
|
|
||||||
|
|
||||||
expect(fs.existsSync(`${sdkDir}.complete`)).toBe(true);
|
|
||||||
expect(fs.existsSync(path.join(sdkDir, 'bin'))).toBe(true);
|
|
||||||
}, 300000);
|
|
||||||
|
|
||||||
it('Downloads flutter from master channel', async () => {
|
|
||||||
await installer.getFlutter('', 'master');
|
|
||||||
const sdkDir = path.join(toolDir, 'flutter', 'master', 'x64');
|
|
||||||
|
|
||||||
let stdout = '';
|
|
||||||
|
|
||||||
const options = {
|
|
||||||
listeners: {
|
|
||||||
stdout: (data: Buffer) => {
|
|
||||||
stdout += data.toString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
expect(fs.existsSync(`${sdkDir}.complete`)).toBe(true);
|
|
||||||
expect(fs.existsSync(path.join(sdkDir, 'bin'))).toBe(true);
|
|
||||||
|
|
||||||
await exec.exec(path.join(sdkDir, 'bin', 'flutter'), ['channel'], options);
|
|
||||||
expect(stdout).toContain('* master');
|
|
||||||
}, 300000);
|
|
||||||
|
|
||||||
it('Throws if no location contains correct flutter version', async () => {
|
|
||||||
let thrown = false;
|
|
||||||
try {
|
|
||||||
await installer.getFlutter('1000.0', 'dev');
|
|
||||||
} catch {
|
|
||||||
thrown = true;
|
|
||||||
}
|
|
||||||
expect(thrown).toBe(true);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -1,145 +0,0 @@
|
|||||||
import fs = require('fs');
|
|
||||||
import path = require('path');
|
|
||||||
import nock = require('nock');
|
|
||||||
import * as release from '../src/release';
|
|
||||||
|
|
||||||
const platform = release.getPlatform();
|
|
||||||
|
|
||||||
describe('release tests', () => {
|
|
||||||
it('getPlatform', () => {
|
|
||||||
const platformMap: {[index: string]: string} = {
|
|
||||||
linux: 'linux',
|
|
||||||
darwin: 'macos',
|
|
||||||
win32: 'windows'
|
|
||||||
};
|
|
||||||
|
|
||||||
expect(platform).toEqual(platformMap[process.platform]);
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('determineVersion', () => {
|
|
||||||
beforeEach(() => {
|
|
||||||
const dataDir = path.join(__dirname, 'data');
|
|
||||||
|
|
||||||
nock('https://storage.googleapis.com', {allowUnmocked: true})
|
|
||||||
.get(`/flutter_infra_release/releases/releases_${platform}.json`)
|
|
||||||
.replyWithFile(200, path.join(dataDir, `releases_${platform}.json`));
|
|
||||||
});
|
|
||||||
|
|
||||||
afterEach(() => {
|
|
||||||
nock.cleanAll();
|
|
||||||
nock.enableNetConnect();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('channel: "stable", version: ""', async () => {
|
|
||||||
const result = await release.determineVersion('', 'stable', platform);
|
|
||||||
|
|
||||||
expect(result.version).toEqual('2.0.5');
|
|
||||||
expect(result.rawVersion).toEqual('2.0.5');
|
|
||||||
expect(result.downloadUrl).toContain('2.0.5');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('channel: "beta", version: ""', async () => {
|
|
||||||
const result = await release.determineVersion('', 'beta', platform);
|
|
||||||
|
|
||||||
expect(result.version).toEqual('2.2.0-10.1.pre');
|
|
||||||
expect(result.rawVersion).toEqual('2.2.0-10.1.pre');
|
|
||||||
expect(result.downloadUrl).toContain('2.2.0-10.1.pre');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('channel: "dev", version: ""', async () => {
|
|
||||||
const result = await release.determineVersion('', 'dev', platform);
|
|
||||||
|
|
||||||
expect(result.version).toEqual('2.2.0-10.1.pre');
|
|
||||||
expect(result.rawVersion).toEqual('2.2.0-10.1.pre');
|
|
||||||
expect(result.downloadUrl).toContain('2.2.0-10.1.pre');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('channel: "dev", version: "1.17.x"', async () => {
|
|
||||||
const result = await release.determineVersion('1.17.x', 'dev', platform);
|
|
||||||
|
|
||||||
expect(result.version).toEqual('1.17.0-dev.5.0');
|
|
||||||
expect(result.rawVersion).toEqual('1.17.0-dev.5.0');
|
|
||||||
expect(result.downloadUrl).toContain('1.17.0-dev.5.0');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('channel: "dev", version: "1.17"', async () => {
|
|
||||||
const result = await release.determineVersion('1.17', 'dev', platform);
|
|
||||||
|
|
||||||
expect(result.version).toEqual('1.17.0-dev.5.0');
|
|
||||||
expect(result.rawVersion).toEqual('1.17.0-dev.5.0');
|
|
||||||
expect(result.downloadUrl).toContain('1.17.0-dev.5.0');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('channel: "dev", version: "1.7.x" (old format)', async () => {
|
|
||||||
const result = await release.determineVersion('1.7.x', 'dev', platform);
|
|
||||||
|
|
||||||
expect(result.version).toEqual('1.7.11');
|
|
||||||
expect(result.rawVersion).toEqual('v1.7.11');
|
|
||||||
expect(result.downloadUrl).toContain('v1.7.11');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('channel: "dev", version: "1.7" (old format)', async () => {
|
|
||||||
const result = await release.determineVersion('1.7', 'dev', platform);
|
|
||||||
|
|
||||||
expect(result.version).toEqual('1.7.11');
|
|
||||||
expect(result.rawVersion).toEqual('v1.7.11');
|
|
||||||
expect(result.downloadUrl).toContain('v1.7.11');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('channel: "dev", version: "0.12.x" (unknown)', async () => {
|
|
||||||
try {
|
|
||||||
await release.determineVersion('0.12.x', 'dev', platform);
|
|
||||||
} catch (e) {
|
|
||||||
expect(e.message).toEqual('unable to find release for 0.12.x');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
it('channel: "dev", version: "0.12" (unknown)', async () => {
|
|
||||||
try {
|
|
||||||
await release.determineVersion('0.12', 'dev', platform);
|
|
||||||
} catch (e) {
|
|
||||||
expect(e.message).toEqual('unable to find release for 0.12');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
it('channel: "dev", version: "1.17.0-dev.5.0"', async () => {
|
|
||||||
const result = await release.determineVersion(
|
|
||||||
'1.17.0-dev.5.0',
|
|
||||||
'dev',
|
|
||||||
platform
|
|
||||||
);
|
|
||||||
|
|
||||||
expect(result.version).toEqual('1.17.0-dev.5.0');
|
|
||||||
expect(result.rawVersion).toEqual('1.17.0-dev.5.0');
|
|
||||||
expect(result.downloadUrl).toContain('1.17.0-dev.5.0');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('channel: "any", version: "1.17.x"', async () => {
|
|
||||||
const result = await release.determineVersion('1.17.x', 'any', platform);
|
|
||||||
|
|
||||||
expect(result.version).toEqual('1.17.5');
|
|
||||||
expect(result.rawVersion).toEqual('1.17.5');
|
|
||||||
expect(result.downloadUrl).toContain('1.17.5');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('channel: "any", version: "1.19.x"', async () => {
|
|
||||||
const result = await release.determineVersion('1.19.x', 'any', platform);
|
|
||||||
|
|
||||||
expect(result.version).toEqual('1.19.0-5.0.pre');
|
|
||||||
expect(result.rawVersion).toEqual('1.19.0-5.0.pre');
|
|
||||||
expect(result.downloadUrl).toContain('1.19.0-5.0.pre');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('channel: "any", version: "1.19.0-4.x"', async () => {
|
|
||||||
const result = await release.determineVersion(
|
|
||||||
'1.19.0-4.x',
|
|
||||||
'any',
|
|
||||||
platform
|
|
||||||
);
|
|
||||||
|
|
||||||
expect(result.version).toEqual('1.19.0-4.3.pre');
|
|
||||||
expect(result.rawVersion).toEqual('1.19.0-4.3.pre');
|
|
||||||
expect(result.downloadUrl).toContain('1.19.0-4.3.pre');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
12
action.yml
12
action.yml
@@ -1,6 +1,9 @@
|
|||||||
name: 'Flutter action'
|
name: 'Flutter action'
|
||||||
description: 'Setup your runner with Flutter environment'
|
description: 'Setup your runner with Flutter environment'
|
||||||
author: 'Alif Rachmawadi'
|
author: 'Alif Rachmawadi'
|
||||||
|
branding:
|
||||||
|
icon: 'maximize'
|
||||||
|
color: 'blue'
|
||||||
inputs:
|
inputs:
|
||||||
flutter-version:
|
flutter-version:
|
||||||
description: 'The Flutter version to make available on the path'
|
description: 'The Flutter version to make available on the path'
|
||||||
@@ -10,8 +13,7 @@ inputs:
|
|||||||
required: false
|
required: false
|
||||||
default: 'stable'
|
default: 'stable'
|
||||||
runs:
|
runs:
|
||||||
using: 'node12'
|
using: 'composite'
|
||||||
main: 'dist/index.js'
|
steps:
|
||||||
branding:
|
- run: $GITHUB_ACTION_PATH/setup.sh ${{ inputs.channel }} ${{ inputs.flutter-version }}
|
||||||
icon: 'maximize'
|
shell: bash
|
||||||
color: 'blue'
|
|
||||||
|
|||||||
8797
dist/index.js
vendored
8797
dist/index.js
vendored
File diff suppressed because it is too large
Load Diff
@@ -1,11 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
clearMocks: true,
|
|
||||||
moduleFileExtensions: ['js', 'ts'],
|
|
||||||
testEnvironment: 'node',
|
|
||||||
testMatch: ['**/*.test.ts'],
|
|
||||||
testRunner: 'jest-circus/runner',
|
|
||||||
transform: {
|
|
||||||
'^.+\\.ts$': 'ts-jest'
|
|
||||||
},
|
|
||||||
verbose: true
|
|
||||||
}
|
|
||||||
6500
package-lock.json
generated
6500
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
53
package.json
53
package.json
@@ -1,53 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "flutter-action",
|
|
||||||
"version": "1.3.2",
|
|
||||||
"private": true,
|
|
||||||
"description": "Flutter environment for use in actions",
|
|
||||||
"main": "lib/index.js",
|
|
||||||
"scripts": {
|
|
||||||
"build-tsc": "tsc",
|
|
||||||
"build-ncc": "ncc build",
|
|
||||||
"build": "run-s build-tsc build-ncc",
|
|
||||||
"format": "prettier --write **/*.ts",
|
|
||||||
"format-check": "prettier --check **/*.ts",
|
|
||||||
"test": "jest"
|
|
||||||
},
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git+https://github.com/subosito/flutter-action.git"
|
|
||||||
},
|
|
||||||
"keywords": [
|
|
||||||
"actions",
|
|
||||||
"node",
|
|
||||||
"flutter",
|
|
||||||
"setup"
|
|
||||||
],
|
|
||||||
"author": "Alif Rachmawadi <arch@subosito.com>",
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"@actions/core": "^1.4.0",
|
|
||||||
"@actions/exec": "^1.1.0",
|
|
||||||
"@actions/http-client": "^1.0.11",
|
|
||||||
"@actions/io": "^1.1.1",
|
|
||||||
"@actions/tool-cache": "^1.7.1",
|
|
||||||
"semver": "^7.3.5",
|
|
||||||
"uuid": "^8.3.2"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@types/jest": "^26.0.23",
|
|
||||||
"@types/node": "^14.17.3",
|
|
||||||
"@types/semver": "^7.3.6",
|
|
||||||
"@types/uuid": "^8.3.0",
|
|
||||||
"@vercel/ncc": "^0.28.6",
|
|
||||||
"jest": "^26.6.3",
|
|
||||||
"jest-circus": "^26.6.3",
|
|
||||||
"nock": "^13.1.0",
|
|
||||||
"npm-run-all": "^4.1.5",
|
|
||||||
"prettier": "1.19.1",
|
|
||||||
"ts-jest": "^26.5.6",
|
|
||||||
"typescript": "^4.3.2"
|
|
||||||
},
|
|
||||||
"resolutions": {
|
|
||||||
"minimist": "^1.2.2"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
94
setup.sh
Executable file
94
setup.sh
Executable file
@@ -0,0 +1,94 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
OS_NAME=$(echo "$RUNNER_OS" | awk '{print tolower($0)}')
|
||||||
|
MANIFEST_BASE_URL="https://storage.googleapis.com/flutter_infra_release/releases"
|
||||||
|
MANIFEST_URL="${MANIFEST_BASE_URL}/releases_${OS_NAME}.json"
|
||||||
|
|
||||||
|
# convert version like 2.5.x to 2.5
|
||||||
|
normalize_version() {
|
||||||
|
if [[ $1 == *x ]]; then
|
||||||
|
echo ${1::-2}
|
||||||
|
else
|
||||||
|
echo $1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
latest_version() {
|
||||||
|
jq --arg channel "$1" '.releases | map(select(.channel==$channel)) | first'
|
||||||
|
}
|
||||||
|
|
||||||
|
wildcard_version() {
|
||||||
|
if [[ $1 == any ]]; then
|
||||||
|
jq --arg version "^$2" '.releases | map(select(.version | test($version))) | first'
|
||||||
|
else
|
||||||
|
jq --arg channel "$1" --arg version "^$2" '.releases | map(select(.channel==$channel) | select(.version | test($version))) | first'
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
get_version() {
|
||||||
|
if [[ -z $2 ]]; then
|
||||||
|
latest_version $1
|
||||||
|
else
|
||||||
|
wildcard_version $1 $2
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
get_version_manifest() {
|
||||||
|
releases_manifest=$(curl --silent --connect-timeout 15 --retry 5 $MANIFEST_URL)
|
||||||
|
version_manifest=$(echo $releases_manifest | get_version $1 $(normalize_version $2))
|
||||||
|
|
||||||
|
if [[ $version_manifest == null ]]; then
|
||||||
|
# fallback through legacy version format
|
||||||
|
echo $releases_manifest | wildcard_version $1 "v$(normalize_version $2)"
|
||||||
|
else
|
||||||
|
echo $version_manifest
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
download_archive() {
|
||||||
|
archive_url="$MANIFEST_BASE_URL/$1"
|
||||||
|
archive_name=$(basename $1)
|
||||||
|
archive_local="$HOME/$archive_name"
|
||||||
|
|
||||||
|
curl --connect-timeout 15 --retry 5 $archive_url >$archive_local
|
||||||
|
|
||||||
|
if [[ $archive_name == *zip ]]; then
|
||||||
|
unzip -o "$archive_local" -d "$2"
|
||||||
|
else
|
||||||
|
tar xf "$archive_local" -C "$2"
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm $archive_local
|
||||||
|
}
|
||||||
|
|
||||||
|
CHANNEL="$1"
|
||||||
|
VERSION="$2"
|
||||||
|
|
||||||
|
if [[ $CHANNEL == master ]]; then
|
||||||
|
git clone -b master https://github.com/flutter/flutter.git "$RUNNER_TOOL_CACHE/flutter"
|
||||||
|
else
|
||||||
|
VERSION_MANIFEST=$(get_version_manifest $CHANNEL $VERSION)
|
||||||
|
|
||||||
|
if [[ $VERSION_MANIFEST == null ]]; then
|
||||||
|
echo "Unable to determine Flutter version for $CHANNEL $VERSION"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
ARCHIVE_PATH=$(echo $VERSION_MANIFEST | jq -r '.archive')
|
||||||
|
download_archive "$ARCHIVE_PATH" "$RUNNER_TOOL_CACHE"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $OS_NAME == windows ]]; then
|
||||||
|
FLUTTER_ROOT="${RUNNER_TOOL_CACHE}\\flutter"
|
||||||
|
PUB_CACHE="${USERPROFILE}\\.pub-cache"
|
||||||
|
else
|
||||||
|
FLUTTER_ROOT="${RUNNER_TOOL_CACHE}/flutter"
|
||||||
|
PUB_CACHE="${HOME}/.pub-cache"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "FLUTTER_ROOT=${FLUTTER_ROOT}" >>$GITHUB_ENV
|
||||||
|
echo "PUB_CACHE=${PUB_CACHE}" >>$GITHUB_ENV
|
||||||
|
|
||||||
|
echo "${FLUTTER_ROOT}/bin" >>$GITHUB_PATH
|
||||||
|
echo "${FLUTTER_ROOT}/bin/cache/dart-sdk/bin" >>$GITHUB_PATH
|
||||||
|
echo "${PUB_CACHE}/bin" >>$GITHUB_PATH
|
||||||
23
src/index.ts
23
src/index.ts
@@ -1,23 +0,0 @@
|
|||||||
import * as core from '@actions/core';
|
|
||||||
import * as installer from './installer';
|
|
||||||
|
|
||||||
async function run() {
|
|
||||||
try {
|
|
||||||
const version = core.getInput('flutter-version') || '';
|
|
||||||
const channel = core.getInput('channel') || 'stable';
|
|
||||||
|
|
||||||
if (channel == 'master' && version != '') {
|
|
||||||
core.setFailed(
|
|
||||||
'using `flutter-version` with master channel is not supported.'
|
|
||||||
);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
await installer.getFlutter(version, channel);
|
|
||||||
} catch (error) {
|
|
||||||
core.setFailed(error.message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
run();
|
|
||||||
128
src/installer.ts
128
src/installer.ts
@@ -1,128 +0,0 @@
|
|||||||
import * as core from '@actions/core';
|
|
||||||
import * as io from '@actions/io';
|
|
||||||
import * as exec from '@actions/exec';
|
|
||||||
import * as tc from '@actions/tool-cache';
|
|
||||||
import * as fs from 'fs';
|
|
||||||
import * as path from 'path';
|
|
||||||
import * as release from './release';
|
|
||||||
|
|
||||||
export async function getFlutter(
|
|
||||||
version: string,
|
|
||||||
channel: string
|
|
||||||
): Promise<void> {
|
|
||||||
const platform = release.getPlatform();
|
|
||||||
const useMaster = channel == 'master';
|
|
||||||
|
|
||||||
const {
|
|
||||||
version: selected,
|
|
||||||
downloadUrl,
|
|
||||||
channel: validatedChannel
|
|
||||||
} = await release.determineVersion(
|
|
||||||
version,
|
|
||||||
useMaster ? 'dev' : channel,
|
|
||||||
platform
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!useMaster && channel !== validatedChannel) {
|
|
||||||
core.debug(`Channel was identified as ${validatedChannel}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
let cleanver = useMaster
|
|
||||||
? channel
|
|
||||||
: `${selected.replace('+', '-')}-${validatedChannel}`;
|
|
||||||
|
|
||||||
let toolPath = tc.find('flutter', cleanver);
|
|
||||||
|
|
||||||
if (toolPath) {
|
|
||||||
core.debug(`Tool found in cache ${toolPath}`);
|
|
||||||
} else {
|
|
||||||
core.debug(`Downloading Flutter from Google storage ${downloadUrl}`);
|
|
||||||
|
|
||||||
const sdkFile = await tc.downloadTool(downloadUrl);
|
|
||||||
const sdkCache = await tmpDir(platform);
|
|
||||||
const sdkDir = await extract(sdkFile, sdkCache, path.basename(downloadUrl));
|
|
||||||
|
|
||||||
toolPath = await tc.cacheDir(sdkDir, 'flutter', cleanver);
|
|
||||||
}
|
|
||||||
|
|
||||||
core.exportVariable('FLUTTER_ROOT', toolPath);
|
|
||||||
|
|
||||||
let pubCachePath = process.env['PUB_CACHE'] || '';
|
|
||||||
|
|
||||||
if (!pubCachePath) {
|
|
||||||
pubCachePath = path.join(toolPath, '.pub-cache');
|
|
||||||
core.exportVariable('PUB_CACHE', pubCachePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
core.addPath(path.join(toolPath, 'bin'));
|
|
||||||
core.addPath(path.join(toolPath, 'bin', 'cache', 'dart-sdk', 'bin'));
|
|
||||||
core.addPath(path.join(pubCachePath, 'bin'));
|
|
||||||
|
|
||||||
if (useMaster) {
|
|
||||||
await exec.exec('flutter', ['channel', 'master']);
|
|
||||||
await exec.exec('flutter', ['upgrade']);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function tmpBaseDir(platform: string): string {
|
|
||||||
let tempDirectory = process.env['RUNNER_TEMP'] || '';
|
|
||||||
|
|
||||||
if (tempDirectory) {
|
|
||||||
return tempDirectory;
|
|
||||||
}
|
|
||||||
|
|
||||||
let baseLocation;
|
|
||||||
|
|
||||||
switch (platform) {
|
|
||||||
case 'windows':
|
|
||||||
baseLocation = process.env['USERPROFILE'] || 'C:\\';
|
|
||||||
break;
|
|
||||||
case 'macos':
|
|
||||||
baseLocation = '/Users';
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
baseLocation = '/home';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return path.join(baseLocation, 'actions', 'temp');
|
|
||||||
}
|
|
||||||
|
|
||||||
async function tmpDir(platform: string): Promise<string> {
|
|
||||||
const baseDir = tmpBaseDir(platform);
|
|
||||||
const tempDir = path.join(
|
|
||||||
baseDir,
|
|
||||||
'temp_' + Math.floor(Math.random() * 2000000000)
|
|
||||||
);
|
|
||||||
|
|
||||||
await io.mkdirP(tempDir);
|
|
||||||
return tempDir;
|
|
||||||
}
|
|
||||||
|
|
||||||
async function extract(
|
|
||||||
sdkFile: string,
|
|
||||||
sdkCache: string,
|
|
||||||
originalFilename: string
|
|
||||||
): Promise<string> {
|
|
||||||
const fileStats = fs.statSync(path.normalize(sdkFile));
|
|
||||||
|
|
||||||
if (fileStats.isFile()) {
|
|
||||||
const stats = fs.statSync(sdkFile);
|
|
||||||
|
|
||||||
if (!stats) {
|
|
||||||
throw new Error(`Failed to extract ${sdkFile} - it doesn't exist`);
|
|
||||||
} else if (stats.isDirectory()) {
|
|
||||||
throw new Error(`Failed to extract ${sdkFile} - it is a directory`);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (originalFilename.endsWith('tar.xz')) {
|
|
||||||
await tc.extractTar(sdkFile, sdkCache, 'x');
|
|
||||||
} else {
|
|
||||||
await tc.extractZip(sdkFile, sdkCache);
|
|
||||||
}
|
|
||||||
|
|
||||||
return path.join(sdkCache, fs.readdirSync(sdkCache)[0]);
|
|
||||||
} else {
|
|
||||||
throw new Error(`Flutter sdk argument ${sdkFile} is not a file`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
199
src/release.ts
199
src/release.ts
@@ -1,199 +0,0 @@
|
|||||||
import * as core from '@actions/core';
|
|
||||||
import * as httpm from '@actions/http-client';
|
|
||||||
import * as semver from 'semver';
|
|
||||||
|
|
||||||
export const storageUrl =
|
|
||||||
'https://storage.googleapis.com/flutter_infra_release/releases';
|
|
||||||
|
|
||||||
interface IFlutterData {
|
|
||||||
channel: string;
|
|
||||||
version: string;
|
|
||||||
rawVersion: string;
|
|
||||||
downloadUrl: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface IFlutterChannel {
|
|
||||||
[key: string]: string;
|
|
||||||
beta: string;
|
|
||||||
dev: string;
|
|
||||||
stable: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface IFlutterRelease {
|
|
||||||
hash: string;
|
|
||||||
channel: string;
|
|
||||||
version: string;
|
|
||||||
archive: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface IFlutterStorage {
|
|
||||||
current_release: IFlutterChannel;
|
|
||||||
releases: IFlutterRelease[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getPlatform(): string {
|
|
||||||
const platform = process.platform;
|
|
||||||
|
|
||||||
if (platform == 'win32') {
|
|
||||||
return 'windows';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (platform == 'darwin') {
|
|
||||||
return 'macos';
|
|
||||||
}
|
|
||||||
|
|
||||||
return platform;
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function determineVersion(
|
|
||||||
version: string,
|
|
||||||
channel: string,
|
|
||||||
platform: string
|
|
||||||
): Promise<IFlutterData> {
|
|
||||||
const storage = await getReleases(platform);
|
|
||||||
|
|
||||||
if (version === '') {
|
|
||||||
return getLatestVersion(storage, channel);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (version.endsWith('.x')) {
|
|
||||||
return getWildcardVersion(storage, channel, version);
|
|
||||||
}
|
|
||||||
|
|
||||||
return getVersion(storage, channel, version);
|
|
||||||
}
|
|
||||||
|
|
||||||
async function getReleases(platform: string): Promise<IFlutterStorage> {
|
|
||||||
const releasesUrl: string = `${storageUrl}/releases_${platform}.json`;
|
|
||||||
const http: httpm.HttpClient = new httpm.HttpClient('flutter-action');
|
|
||||||
const storage: IFlutterStorage | null = (
|
|
||||||
await http.getJson<IFlutterStorage | null>(releasesUrl)
|
|
||||||
).result;
|
|
||||||
|
|
||||||
if (!storage) {
|
|
||||||
throw new Error('unable to get flutter releases');
|
|
||||||
}
|
|
||||||
|
|
||||||
return storage;
|
|
||||||
}
|
|
||||||
|
|
||||||
async function getLatestVersion(
|
|
||||||
storage: IFlutterStorage,
|
|
||||||
channel: string
|
|
||||||
): Promise<IFlutterData> {
|
|
||||||
const channelVersion = storage.releases.find(release => {
|
|
||||||
return (
|
|
||||||
release.hash === storage.current_release[channel] &&
|
|
||||||
validateChannel(release.channel, channel)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!channelVersion) {
|
|
||||||
throw new Error(`unable to get latest version from channel ${channel}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
let rver = channelVersion.version;
|
|
||||||
let cver = rver.startsWith('v') ? rver.slice(1, rver.length) : rver;
|
|
||||||
|
|
||||||
core.debug(`latest version from channel ${channel} is ${rver}`);
|
|
||||||
|
|
||||||
const flutterData: IFlutterData = {
|
|
||||||
channel: channelVersion.channel,
|
|
||||||
version: cver,
|
|
||||||
rawVersion: rver,
|
|
||||||
downloadUrl: `${storageUrl}/${channelVersion.archive}`
|
|
||||||
};
|
|
||||||
|
|
||||||
return flutterData;
|
|
||||||
}
|
|
||||||
|
|
||||||
function validateChannel(releaseChannel: string, channel: string) {
|
|
||||||
return releaseChannel === channel || channel === 'any';
|
|
||||||
}
|
|
||||||
|
|
||||||
async function getWildcardVersion(
|
|
||||||
storage: IFlutterStorage,
|
|
||||||
channel: string,
|
|
||||||
version: string
|
|
||||||
): Promise<IFlutterData> {
|
|
||||||
let sver = version.endsWith('.x')
|
|
||||||
? version.slice(0, version.length - 2)
|
|
||||||
: version;
|
|
||||||
|
|
||||||
const releases = storage.releases.filter(release => {
|
|
||||||
return (
|
|
||||||
validateChannel(release.channel, channel) &&
|
|
||||||
prefixCompare(sver, release.version)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
const versions = releases
|
|
||||||
.map(release => release.version)
|
|
||||||
.map(version =>
|
|
||||||
version.startsWith('v') ? version.slice(1, version.length) : version
|
|
||||||
);
|
|
||||||
|
|
||||||
const sortedVersions = versions.sort(semver.rcompare);
|
|
||||||
|
|
||||||
let cver = sortedVersions[0];
|
|
||||||
let release = releases.find(release => compare(cver, release.version));
|
|
||||||
|
|
||||||
if (!release) {
|
|
||||||
throw new Error(`unable to find release for ${version}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
core.debug(
|
|
||||||
`latest version of ${version} from channel ${channel} is ${release.version}`
|
|
||||||
);
|
|
||||||
|
|
||||||
const flutterData = {
|
|
||||||
channel: release.channel,
|
|
||||||
version: cver,
|
|
||||||
rawVersion: release.version,
|
|
||||||
downloadUrl: `${storageUrl}/${release.archive}`
|
|
||||||
};
|
|
||||||
|
|
||||||
return flutterData;
|
|
||||||
}
|
|
||||||
|
|
||||||
async function getVersion(
|
|
||||||
storage: IFlutterStorage,
|
|
||||||
channel: string,
|
|
||||||
version: string
|
|
||||||
): Promise<IFlutterData> {
|
|
||||||
const release = storage.releases.find(release => {
|
|
||||||
return (
|
|
||||||
validateChannel(release.channel, channel) &&
|
|
||||||
compare(version, release.version)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!release) {
|
|
||||||
return getWildcardVersion(storage, channel, version);
|
|
||||||
}
|
|
||||||
|
|
||||||
const flutterData = {
|
|
||||||
channel: release.channel,
|
|
||||||
version,
|
|
||||||
rawVersion: release.version,
|
|
||||||
downloadUrl: `${storageUrl}/${release.archive}`
|
|
||||||
};
|
|
||||||
|
|
||||||
return flutterData;
|
|
||||||
}
|
|
||||||
|
|
||||||
function compare(version: string, releaseVersion: string): boolean {
|
|
||||||
if (releaseVersion.startsWith('v')) {
|
|
||||||
return releaseVersion === `v${version}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
return releaseVersion === version;
|
|
||||||
}
|
|
||||||
|
|
||||||
function prefixCompare(version: string, releaseVersion: string): boolean {
|
|
||||||
if (releaseVersion.startsWith('v')) {
|
|
||||||
return releaseVersion.startsWith(`v${version}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
return releaseVersion.startsWith(version);
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
{
|
|
||||||
"compilerOptions": {
|
|
||||||
"target": "es6",
|
|
||||||
"module": "commonjs",
|
|
||||||
"outDir": "./lib",
|
|
||||||
"rootDir": "./src",
|
|
||||||
"strict": true,
|
|
||||||
"esModuleInterop": true
|
|
||||||
},
|
|
||||||
"exclude": ["node_modules", "**/*.test.ts"]
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user