Compare commits

..

115 Commits

Author SHA1 Message Date
Alif Rachmawadi
d5878a0492 quiet unzip (fixes #130)
Some checks failed
Main workflow / test_channel (beta, macos-latest) (push) Failing after 2s
Main workflow / test_channel (dev, macos-latest) (push) Failing after 2s
Main workflow / test_channel (stable, macos-latest) (push) Failing after 2s
Main workflow / test_cache (macos-latest) (push) Failing after 3s
Main workflow / test_channel (stable, ubuntu-latest) (push) Failing after 33s
Main workflow / test_version (2.5.3) (push) Failing after 33s
Main workflow / test_cache (ubuntu-latest) (push) Failing after 17s
Main workflow / test_channel (beta, ubuntu-latest) (push) Failing after 17s
Main workflow / test_channel (dev, ubuntu-latest) (push) Failing after 1m38s
Main workflow / test_version (1) (push) Failing after 32s
Main workflow / test_version (2.x) (push) Failing after 32s
Main workflow / test_version (v1.12) (push) Failing after 6m16s
Main workflow / test_any_channel (push) Failing after 8s
Main workflow / test_channel (beta, windows-latest) (push) Has been cancelled
Main workflow / test_master_channel (push) Has been cancelled
Main workflow / test_channel (dev, windows-latest) (push) Has been cancelled
Main workflow / test_channel (stable, windows-latest) (push) Has been cancelled
Main workflow / test_cache (windows-latest) (push) Has been cancelled
2022-01-24 04:44:12 +00:00
Alif Rachmawadi
31089a7435 update readme
Some checks failed
Main workflow / test_channel (beta, macos-latest) (push) Failing after 2s
Main workflow / test_cache (macos-latest) (push) Failing after 3s
Main workflow / test_channel (dev, macos-latest) (push) Failing after 2s
Main workflow / test_channel (stable, macos-latest) (push) Failing after 2s
Main workflow / test_channel (beta, ubuntu-latest) (push) Failing after 6m31s
Main workflow / test_channel (stable, ubuntu-latest) (push) Failing after 10s
Main workflow / test_version (v1.12) (push) Failing after 25s
Main workflow / test_any_channel (push) Failing after 16s
Main workflow / test_channel (dev, ubuntu-latest) (push) Failing after 18s
Main workflow / test_version (1) (push) Failing after 9s
Main workflow / test_version (2.5.3) (push) Failing after 8s
Main workflow / test_version (2.x) (push) Failing after 9s
Main workflow / test_cache (ubuntu-latest) (push) Failing after 18s
Main workflow / test_channel (beta, windows-latest) (push) Has been cancelled
Main workflow / test_channel (dev, windows-latest) (push) Has been cancelled
Main workflow / test_channel (stable, windows-latest) (push) Has been cancelled
Main workflow / test_master_channel (push) Has been cancelled
Main workflow / test_cache (windows-latest) (push) Has been cancelled
2022-01-13 11:02:57 +00:00
Alif Rachmawadi
4f5d1c6d12 add cache path option 2022-01-13 10:46:00 +00:00
Alif Rachmawadi
03e576dcd6 actions/cache integration
Some checks failed
Main workflow / test_channel (beta, macos-latest) (push) Failing after 1s
Main workflow / test_channel (stable, macos-latest) (push) Failing after 2s
Main workflow / test_cache (macos-latest) (push) Failing after 3s
Main workflow / test_channel (dev, macos-latest) (push) Failing after 2s
Main workflow / test_channel (beta, ubuntu-latest) (push) Failing after 49s
Main workflow / test_channel (dev, ubuntu-latest) (push) Failing after 9s
Main workflow / test_channel (stable, ubuntu-latest) (push) Failing after 9s
Main workflow / test_version (1) (push) Failing after 8s
Main workflow / test_version (2.5.3) (push) Failing after 9s
Main workflow / test_version (2.x) (push) Failing after 9s
Main workflow / test_version (v1.12) (push) Failing after 20s
Main workflow / test_any_channel (push) Failing after 15s
Main workflow / test_cache (ubuntu-latest) (push) Failing after 10s
Main workflow / test_channel (beta, windows-latest) (push) Has been cancelled
Main workflow / test_channel (dev, windows-latest) (push) Has been cancelled
Main workflow / test_channel (stable, windows-latest) (push) Has been cancelled
Main workflow / test_master_channel (push) Has been cancelled
Main workflow / test_cache (windows-latest) (push) Has been cancelled
2022-01-10 04:45:27 +00:00
Alif Rachmawadi
f95a8c953b add actions/cache support
Some checks failed
Main workflow / test_channel (beta, ubuntu-latest) (push) Failing after 8s
Main workflow / test_channel (dev, ubuntu-latest) (push) Failing after 18s
Main workflow / test_channel (stable, ubuntu-latest) (push) Failing after 8s
Main workflow / test_version (2.5.3) (push) Failing after 33s
Main workflow / test_any_channel (push) Failing after 15s
Main workflow / test_version (1) (push) Failing after 2m16s
Main workflow / test_version (2.x) (push) Failing after 32s
Main workflow / test_version (v1.12) (push) Failing after 23s
Main workflow / test_with_cache (push) Failing after 1m15s
Main workflow / test_channel (beta, macos-latest) (push) Failing after 3s
Main workflow / test_channel (dev, macos-latest) (push) Failing after 2s
Main workflow / test_channel (stable, macos-latest) (push) Failing after 2s
Main workflow / test_channel (beta, windows-latest) (push) Has been cancelled
Main workflow / test_channel (dev, windows-latest) (push) Has been cancelled
Main workflow / test_channel (stable, windows-latest) (push) Has been cancelled
Main workflow / test_master_channel (push) Has been cancelled
2022-01-07 04:54:02 +00:00
Alif Rachmawadi
3dae472464 update readme 2022-01-06 16:00:13 +00:00
Alif Rachmawadi
523b0faa40 update readme for linux desktop dependencies (closes #49) 2022-01-06 11:45:16 +00:00
Alif Rachmawadi
813937b170 update readme for desktop build (closes #86) 2022-01-06 11:17:49 +00:00
Alif Rachmawadi
8af4ab61aa update readme 2022-01-06 11:12:10 +00:00
Alif Rachmawadi
59a5481c7d fix PUB_CACHE env
Some checks failed
Main workflow / test_channel (beta, ubuntu-latest) (push) Failing after 16s
Main workflow / test_channel (dev, ubuntu-latest) (push) Failing after 16s
Main workflow / test_version (1) (push) Failing after 7s
Main workflow / test_version (v1.12) (push) Failing after 14s
Main workflow / test_channel (stable, ubuntu-latest) (push) Failing after 19s
Main workflow / test_version (2.5.3) (push) Failing after 7s
Main workflow / test_version (2.x) (push) Failing after 14s
Main workflow / test_any_channel (push) Failing after 15s
Main workflow / test_channel (beta, macos-latest) (push) Failing after 2s
Main workflow / test_channel (dev, macos-latest) (push) Failing after 2s
Main workflow / test_channel (stable, macos-latest) (push) Failing after 2s
Main workflow / test_channel (dev, windows-latest) (push) Has been cancelled
Main workflow / test_channel (stable, windows-latest) (push) Has been cancelled
Main workflow / test_master_channel (push) Has been cancelled
Main workflow / test_channel (beta, windows-latest) (push) Has been cancelled
2022-01-06 10:46:35 +00:00
Alif Rachmawadi
4686a99fc5 update readme
Some checks failed
Main workflow / test_channel (stable, macos-latest) (push) Failing after 3s
Main workflow / test_channel (beta, macos-latest) (push) Failing after 2s
Main workflow / test_channel (dev, macos-latest) (push) Failing after 2s
Main workflow / test_channel (beta, ubuntu-latest) (push) Failing after 15s
Main workflow / test_channel (dev, ubuntu-latest) (push) Failing after 9s
Main workflow / test_channel (stable, ubuntu-latest) (push) Failing after 8s
Main workflow / test_version (1) (push) Failing after 7s
Main workflow / test_version (2.5.3) (push) Failing after 14s
Main workflow / test_version (2.x) (push) Failing after 8s
Main workflow / test_version (v1.12) (push) Failing after 8s
Main workflow / test_any_channel (push) Failing after 8s
Main workflow / test_channel (beta, windows-latest) (push) Has been cancelled
Main workflow / test_channel (dev, windows-latest) (push) Has been cancelled
Main workflow / test_channel (stable, windows-latest) (push) Has been cancelled
Main workflow / test_master_channel (push) Has been cancelled
2022-01-06 09:55:43 +00:00
Alif Rachmawadi
2f01469b02 remove unused files
Some checks failed
Main workflow / test_channel (beta, ubuntu-latest) (push) Failing after 10s
Main workflow / test_channel (dev, ubuntu-latest) (push) Failing after 15s
Main workflow / test_channel (stable, ubuntu-latest) (push) Failing after 19s
Main workflow / test_version (1) (push) Failing after 15s
Main workflow / test_version (2.5.3) (push) Failing after 16s
Main workflow / test_version (2.x) (push) Failing after 8s
Main workflow / test_any_channel (push) Failing after 15s
Main workflow / test_version (v1.12) (push) Failing after 9s
Main workflow / test_channel (beta, macos-latest) (push) Failing after 2s
Main workflow / test_channel (dev, macos-latest) (push) Failing after 1s
Main workflow / test_channel (stable, macos-latest) (push) Failing after 2s
Main workflow / test_channel (beta, windows-latest) (push) Has been cancelled
Main workflow / test_channel (dev, windows-latest) (push) Has been cancelled
Main workflow / test_channel (stable, windows-latest) (push) Has been cancelled
Main workflow / test_master_channel (push) Has been cancelled
2022-01-06 09:31:17 +00:00
Alif Rachmawadi
f6d2e5de5d update readme 2022-01-06 09:23:09 +00:00
Alif Rachmawadi
f5fec4dcb7 remove unused files 2022-01-06 09:22:58 +00:00
Alif Rachmawadi
37e2edb15e add any channel 2022-01-06 09:21:17 +00:00
Alif Rachmawadi
c64fa18722 add master channel 2022-01-06 09:05:37 +00:00
Alif Rachmawadi
a3bd2fdf17 add version matrix test 2022-01-06 08:57:24 +00:00
Alif Rachmawadi
a7e6ec0df9 add PUBCACHE 2022-01-06 08:48:07 +00:00
Alif Rachmawadi
23835ee500 add dart bin to path 2022-01-06 08:45:45 +00:00
Alif Rachmawadi
84b5c35087 download archive 2022-01-06 08:38:04 +00:00
Alif Rachmawadi
365543a8d9 update env name 2022-01-06 07:51:59 +00:00
Alif Rachmawadi
49d7a2a9ae rewrite flutter-action 2022-01-06 07:48:39 +00:00
Alif Rachmawadi
409aab1aac Merge pull request #119 from subosito/dependabot/npm_and_yarn/ansi-regex-5.0.1
Bump ansi-regex from 5.0.0 to 5.0.1
2021-11-17 15:46:32 +07:00
Alif Rachmawadi
f0c3acec24 Merge pull request #95 from tianhaoz95/fix/update-java-requirements
chore: migrate setup java in the instructions to v2
2021-11-17 15:28:02 +07:00
dependabot[bot]
399a47813e Bump ansi-regex from 5.0.0 to 5.0.1
Bumps [ansi-regex](https://github.com/chalk/ansi-regex) from 5.0.0 to 5.0.1.
- [Release notes](https://github.com/chalk/ansi-regex/releases)
- [Commits](https://github.com/chalk/ansi-regex/compare/v5.0.0...v5.0.1)

---
updated-dependencies:
- dependency-name: ansi-regex
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-17 08:27:53 +00:00
Alif Rachmawadi
87ca224aa8 Merge pull request #114 from subosito/dependabot/npm_and_yarn/tmpl-1.0.5
Bump tmpl from 1.0.4 to 1.0.5
2021-11-17 15:27:12 +07:00
dependabot[bot]
a1905c800f Bump tmpl from 1.0.4 to 1.0.5
Bumps [tmpl](https://github.com/daaku/nodejs-tmpl) from 1.0.4 to 1.0.5.
- [Release notes](https://github.com/daaku/nodejs-tmpl/releases)
- [Commits](https://github.com/daaku/nodejs-tmpl/commits/v1.0.5)

---
updated-dependencies:
- dependency-name: tmpl
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-21 11:54:45 +00:00
Alif Rachmawadi
14cf1a3f11 Merge pull request #111 from subosito/dependabot/npm_and_yarn/path-parse-1.0.7
Bump path-parse from 1.0.6 to 1.0.7
2021-08-13 16:11:10 +07:00
dependabot[bot]
858d2d954a Bump path-parse from 1.0.6 to 1.0.7
Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/jbgutierrez/path-parse/releases)
- [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7)

---
updated-dependencies:
- dependency-name: path-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-11 08:46:00 +00:00
Alif Rachmawadi
4389e6cbc6 re-use new releases assets url path
Some checks failed
Main workflow / Run (ubuntu-latest) (push) Failing after 33s
Main workflow / Run (macos-latest) (push) Failing after 3s
Main workflow / Run (windows-latest) (push) Has been cancelled
2021-06-14 02:47:16 +00:00
Alif Rachmawadi
a471b152dc Merge pull request #97 from subosito/dependabot/npm_and_yarn/ws-7.4.6
Some checks failed
Main workflow / Run (ubuntu-latest) (push) Failing after 10m41s
Main workflow / Run (macos-latest) (push) Failing after 4s
Main workflow / Run (windows-latest) (push) Has been cancelled
Bump ws from 7.4.5 to 7.4.6
2021-06-11 15:33:35 +07:00
dependabot[bot]
56a652e69d Bump ws from 7.4.5 to 7.4.6
Bumps [ws](https://github.com/websockets/ws) from 7.4.5 to 7.4.6.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/7.4.5...7.4.6)

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-11 08:20:48 +00:00
Alif Rachmawadi
8e1e9c4d87 update dist 2021-06-11 08:19:02 +00:00
Alif Rachmawadi
017da32f19 update dependencies 2021-06-11 08:18:38 +00:00
Alif Rachmawadi
cb226e935b Back to original path of release assets 2021-06-11 08:13:00 +00:00
Alif Rachmawadi
5188e41281 Merge pull request #100 from chatsen/master
Some checks failed
Main workflow / Run (ubuntu-latest) (push) Failing after 16m22s
Main workflow / Run (macos-latest) (push) Failing after 3s
Main workflow / Run (windows-latest) (push) Has been cancelled
Fix the endpoint for flutter releases
2021-06-02 10:48:10 +07:00
William Bulin
1ced41a989 Update index.js 2021-06-02 01:38:26 +02:00
William Bulin
4ac301c302 Update release.ts 2021-06-02 01:36:53 +02:00
Tianhao Zhou
5c3d315241 fix: add missing arguments for java setup 2021-05-17 01:10:08 -07:00
Alif Rachmawadi
0600af6a5c Merge pull request #93 from subosito/dependabot/npm_and_yarn/hosted-git-info-2.8.9
Bump hosted-git-info from 2.7.1 to 2.8.9
2021-05-15 14:04:20 +07:00
dependabot[bot]
1c63d3b831 Bump hosted-git-info from 2.7.1 to 2.8.9
Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.7.1 to 2.8.9.
- [Release notes](https://github.com/npm/hosted-git-info/releases)
- [Changelog](https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md)
- [Commits](https://github.com/npm/hosted-git-info/compare/v2.7.1...v2.8.9)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-11 01:25:41 +00:00
Alif Rachmawadi
086f9fb649 Merge pull request #90 from kuhnroyal/feature/pub-cache
Export PUB_CACHE if it is not in env
2021-05-01 08:31:38 +07:00
Peter Leibiger
8f6ad7c383 Export PUB_CACHE if it is not in env
Export `PUB_CACHE` if it is not configured before calling the action.
This ensures that flutter and dart use the same cache.
It also enables other tools to use this official Dart env variable.
2021-04-28 20:43:14 +02:00
Alif Rachmawadi
13141e86c3 update readme
Some checks failed
Main workflow / Run (ubuntu-latest) (push) Failing after 10m31s
Main workflow / Run (macos-latest) (push) Failing after 3s
Main workflow / Run (windows-latest) (push) Has been cancelled
2021-04-26 14:56:05 +00:00
Alif Rachmawadi
41992c08db adjust windows example 2021-04-26 14:49:19 +00:00
Alif Rachmawadi
d94ad8f4a5 Merge pull request #68 from majudhu/patch-1
add example to build for windows
2021-04-26 21:47:15 +07:00
Alif Rachmawadi
7bb7a2ead1 pin prettier 2021-04-26 14:35:27 +00:00
Alif Rachmawadi
08d7837173 update dist 2021-04-26 14:31:40 +00:00
Alif Rachmawadi
cb118effe2 update dependencies 2021-04-26 14:30:05 +00:00
Alif Rachmawadi
8c0828b9c2 update readme 2021-04-26 14:24:54 +00:00
Alif Rachmawadi
30d8b6aed2 update tests 2021-04-26 14:24:40 +00:00
Alif Rachmawadi
e7b018ff3a Merge pull request #83 from subosito/dependabot/npm_and_yarn/y18n-4.0.1
Bump y18n from 4.0.0 to 4.0.1
2021-04-02 20:14:32 +07:00
dependabot[bot]
267db14c3d Bump y18n from 4.0.0 to 4.0.1
Bumps [y18n](https://github.com/yargs/y18n) from 4.0.0 to 4.0.1.
- [Release notes](https://github.com/yargs/y18n/releases)
- [Changelog](https://github.com/yargs/y18n/blob/master/CHANGELOG.md)
- [Commits](https://github.com/yargs/y18n/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-30 22:16:18 +00:00
Alif Rachmawadi
123325ea84 Merge pull request #79 from jpnurmi/pub-cache-path
Add .pub-cache/bin to PATH
2021-03-07 19:03:55 +07:00
J-P Nurmi
06a5370154 Add .pub-cache/bin to PATH 2021-03-05 18:29:25 +01:00
Alif Rachmawadi
5781588262 Merge pull request #71 from subosito/dependabot/npm_and_yarn/node-notifier-8.0.1
Bump node-notifier from 8.0.0 to 8.0.1
2021-01-07 09:38:37 +07:00
dependabot[bot]
2d5af0bae8 Bump node-notifier from 8.0.0 to 8.0.1
Bumps [node-notifier](https://github.com/mikaelbr/node-notifier) from 8.0.0 to 8.0.1.
- [Release notes](https://github.com/mikaelbr/node-notifier/releases)
- [Changelog](https://github.com/mikaelbr/node-notifier/blob/v8.0.1/CHANGELOG.md)
- [Commits](https://github.com/mikaelbr/node-notifier/compare/v8.0.0...v8.0.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-22 08:02:28 +00:00
Alif Rachmawadi
d2a92405ab update examples 2020-12-01 15:49:09 +00:00
Alif Rachmawadi
c1329a99f0 fix test 2020-12-01 15:44:22 +00:00
Alif Rachmawadi
618ffe6e1a Merge pull request #67 from dmitry-shibanov/add-any-channel
Add any channel
2020-12-01 22:08:51 +07:00
Majudhu
1b4d6c711f add example to build for windows
add example script which will build a windows executable and also upload it to action artifacts
2020-11-25 14:07:49 +05:00
Dmitry Shibanov
2ed9c88ae0 build project 2020-11-23 16:13:25 +03:00
Dmitry Shibanov
d8b5280c4b add any channel 2020-11-23 16:11:57 +03:00
Alif Rachmawadi
8ffad233a0 Merge pull request #66 from sidrao2006/patch-1
Use FLUTTER_ROOT instead of FLUTTER_HOME
2020-11-21 05:57:49 +07:00
Aneesh Rao
2dc29df57b Use FLUTTER_ROOT instead of FLUTTER_HOME 2020-11-19 20:31:28 +05:30
Alif Rachmawadi
d141f1640a Merge pull request #64 from cclauss/patch-1
README.md: actions/checkout@v2
2020-10-20 20:03:42 +07:00
Christian Clauss
c4e0544d9c fixup! Fix typo 2020-10-20 14:50:34 +02:00
Christian Clauss
2ff7205390 README.md: actions/checkout@v2 2020-10-14 12:50:28 +02:00
Alif Rachmawadi
4a44bbb8a6 update dist 2020-10-08 04:42:13 +00:00
Alif Rachmawadi
d7578c4eec add support for master channel 2020-10-08 04:36:23 +00:00
Alif Rachmawadi
26bf50084a update test platform map
Some checks failed
Main workflow / Run (ubuntu-latest) (push) Failing after 16m21s
Main workflow / Run (macos-latest) (push) Failing after 2s
Main workflow / Run (windows-latest) (push) Has been cancelled
2020-10-08 01:36:34 +00:00
Alif Rachmawadi
45483e4c19 increase test timeout 2020-10-08 01:32:27 +00:00
Alif Rachmawadi
6f4d1ee832 use exact prettier 2020-10-08 01:26:57 +00:00
Alif Rachmawadi
58a4d54c5d update dist 2020-10-08 01:24:34 +00:00
Alif Rachmawadi
d0e7441034 update installer 2020-10-08 01:22:27 +00:00
Alif Rachmawadi
c7c0640db8 add release version check function 2020-10-08 01:22:02 +00:00
Alif Rachmawadi
1aaec8dd0f update dependencies 2020-10-08 01:20:47 +00:00
Alif Rachmawadi
ddb7b913ca update test data 2020-10-08 01:19:56 +00:00
Alif Rachmawadi
0b6cdde020 Merge pull request #60 from subosito/dependabot/npm_and_yarn/actions/core-1.2.6
Bump @actions/core from 1.2.4 to 1.2.6
2020-10-07 19:26:56 +07:00
dependabot[bot]
8078702ac6 Bump @actions/core from 1.2.4 to 1.2.6
Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.2.4 to 1.2.6.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-01 17:17:20 +00:00
Alif Rachmawadi
282b38c3d9 Merge pull request #30 from AlessioLuciani/master
Add iOS and Android app bundle builds
2020-08-14 10:12:00 +07:00
Alif Rachmawadi
12d5ce54d2 Merge pull request #53 from subosito/dependabot/npm_and_yarn/lodash-4.17.19
Bump lodash from 4.17.15 to 4.17.19
2020-07-22 17:03:20 +07:00
dependabot[bot]
d00139d608 Bump lodash from 4.17.15 to 4.17.19
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.19)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-18 00:09:06 +00:00
Alessio Luciani
5d4e01ab3b Add build instructions for the web 2020-06-19 16:13:08 +02:00
Alif Rachmawadi
40bc2f6940 bump version
Some checks failed
Main workflow / Run (ubuntu-latest) (push) Failing after 39m38s
Main workflow / Run (macos-latest) (push) Failing after 3s
Main workflow / Run (windows-latest) (push) Has been cancelled
2020-05-09 11:03:06 +07:00
Alif Rachmawadi
f0d790518f update dist 2020-05-09 10:37:01 +07:00
Alif Rachmawadi
c4a41752bd update dependencies 2020-05-09 10:36:22 +07:00
Alif Rachmawadi
929035d687 update test 2020-05-09 10:17:16 +07:00
Alif Rachmawadi
4bb529986f use channel for latest release 2020-05-09 09:46:10 +07:00
Alif Rachmawadi
ecb8eabe6f update tests 2020-05-09 09:43:40 +07:00
Alif Rachmawadi
cf426f9aa2 update release manifest 2020-05-09 09:43:05 +07:00
Alif Rachmawadi
794e42ad48 bump version: 1.3.1
Some checks failed
Main workflow / Run (macos-latest) (push) Failing after 3s
Main workflow / Run (ubuntu-latest) (push) Failing after 19m55s
Main workflow / Run (windows-latest) (push) Has been cancelled
2020-04-30 09:48:20 +07:00
Alif Rachmawadi
2dd537cc3f update dist 2020-04-30 09:47:38 +07:00
Alif Rachmawadi
3ba093556e Merge pull request #36 from subosito/dependabot/npm_and_yarn/actions/http-client-1.0.8
Bump @actions/http-client from 1.0.7 to 1.0.8
2020-04-30 09:45:20 +07:00
dependabot[bot]
9cde868c41 Bump @actions/http-client from 1.0.7 to 1.0.8
Bumps [@actions/http-client](https://github.com/actions/http-client) from 1.0.7 to 1.0.8.
- [Release notes](https://github.com/actions/http-client/releases)
- [Changelog](https://github.com/actions/http-client/blob/master/RELEASES.md)
- [Commits](https://github.com/actions/http-client/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2020-04-29 18:01:31 +00:00
Alif Rachmawadi
c1bf65eb31 add dart usage example
Some checks failed
Main workflow / Run (macos-latest) (push) Failing after 3s
Main workflow / Run (ubuntu-latest) (push) Failing after 33s
Main workflow / Run (windows-latest) (push) Has been cancelled
2020-04-14 02:34:44 +00:00
Alif Rachmawadi
cfb544479d use previous prettier 2020-04-14 02:31:17 +00:00
Alif Rachmawadi
c256877acc bump version 2020-04-14 02:20:56 +00:00
Alif Rachmawadi
5c02dc7f05 update dist 2020-04-14 02:19:57 +00:00
Alif Rachmawadi
4d34db08ae update dependencies 2020-04-14 02:19:33 +00:00
Alif Rachmawadi
b4d02d2183 update test duration 2020-04-14 02:05:13 +00:00
Alif Rachmawadi
713f696c59 update test 2020-04-14 01:47:20 +00:00
Alif Rachmawadi
c8f591812e update dist 2020-04-14 01:17:42 +00:00
Alif Rachmawadi
f7a5d4550a handle new release format 2020-04-14 01:14:56 +00:00
Alif Rachmawadi
19074769c8 add test for new release format 2020-04-14 01:14:55 +00:00
Alif Rachmawadi
1b5073106b update releases data 2020-04-14 01:14:55 +00:00
Alif Rachmawadi
a8119581ff npm audit fix 2020-04-14 01:14:54 +00:00
Alif Rachmawadi
0ee5f96289 Merge pull request #33 from tianhaoz95/patch-2
might be interesting to add dart SDK to path
2020-04-14 07:57:34 +07:00
Tianhao Zhou
9d3762c82e fix: use join to comply with other os 2020-04-13 14:41:49 -07:00
Tianhao Zhou
6ebddd1b83 fix: add the missing bin directory in dart sdk 2020-04-11 18:23:34 -07:00
Tianhao Zhou
a79364fc11 dev: add dart sdk to path
Adding Flutter bin to the path doesn't expose the dart SDK which many people might be interested in using. For example, dartdoc for documentation generation.
2020-04-11 18:10:01 -07:00
Alessio Luciani
a81c830097 Add iOS and Android app bundle builds
Solving issue https://github.com/subosito/flutter-action/issues/7 .
2020-04-09 14:40:15 +02:00
Alif Rachmawadi
f4209dc839 force minimist resolution 2020-03-17 09:38:25 +07:00
Alif Rachmawadi
cf2fb6cf42 update depedencies 2020-03-17 09:06:14 +07:00
Alif Rachmawadi
8828996b00 fix acorn vulnerabilities 2020-03-17 09:00:22 +07:00
17 changed files with 352 additions and 17974 deletions

View File

@@ -1,8 +1,78 @@
name: Main workflow
on: [push]
jobs:
run:
name: Run
test_channel:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ubuntu-latest, windows-latest, macos-latest]
channel: [stable, beta, dev]
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: ./
with:
channel: ${{ matrix.channel }}
- name: Print FLUTTER_ROOT
shell: bash
run: echo "FLUTTER_ROOT set to $FLUTTER_ROOT"
- name: Print PUB_CACHE
shell: bash
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
test_cache:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
@@ -10,13 +80,16 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set Node.js 10.x
uses: actions/setup-node@v1
- uses: ./
with:
node-version: 10.x
- name: npm install
run: npm install
- name: Lint
run: npm run format-check
- name: npm test
run: npm test
channel: stable
flutter-version: 2.5.0
cache: true
cache-key: key-20220113
cache-path: ${{ runner.tool_cache }}/flutter/2.5.0-stable
- name: Run dart --version
shell: bash
run: dart --version
- name: Run flutter --version
shell: bash
run: flutter --version

3
.gitignore vendored
View File

@@ -1,3 +0,0 @@
node_modules/
lib/
__tests__/runner/*

View File

@@ -1,11 +0,0 @@
{
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"trailingComma": "none",
"bracketSpacing": false,
"arrowParens": "avoid",
"parser": "typescript"
}

173
README.md
View File

@@ -1,77 +1,162 @@
# flutter-action
This action sets up a flutter environment for use in actions. It works on Linux, Windows, and macOS.
Flutter environment for use in GitHub Actions. It works on Linux, Windows, and macOS.
# Usage
## Usage
Use specific version and channel:
```yaml
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v2
with:
java-version: '12.x'
- uses: subosito/flutter-action@v1
with:
flutter-version: '1.9.1+hotfix.6'
- run: flutter pub get
- run: flutter test
- run: flutter build apk
flutter-version: '2.8.0'
channel: 'stable'
- run: flutter --version
```
Use latest release for particular channel:
```yaml
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v2
with:
java-version: '12.x'
- uses: subosito/flutter-action@v1
with:
channel: 'stable' # or: 'dev' or 'beta'
- run: flutter pub get
- run: flutter test
- run: flutter build apk
channel: 'stable' # or: 'beta', 'dev' or 'master'
- run: flutter --version
```
Use latest release for particular version and/or channel:
```yaml
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v2
with:
java-version: '12.x'
- uses: subosito/flutter-action@v1
flutter-version: '1.22.x' # or, you can use 1.22
channel: 'dev'
- run: flutter --version
```
Use particular version on any channel:
```yaml
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v2
with:
flutter-version: '1.12.x' # you can use 1.12
channel: 'dev' # optional, default to: 'stable'
flutter-version: '2.x'
channel: 'any'
- run: flutter --version
```
Build Android APK and app bundle:
```yaml
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '11'
- uses: subosito/flutter-action@v2
with:
flutter-version: '2.5.3'
- run: flutter pub get
- run: flutter test
- run: flutter build apk
- run: flutter build appbundle
```
Matrix Testing:
Build for iOS (macOS only):
```yaml
jobs:
test:
name: Test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
with:
java-version: '12.x'
- uses: subosito/flutter-action@v1
with:
flutter-version: '1.11.0'
channel: 'beta'
- run: flutter pub get
- run: flutter test
- run: flutter build apk
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v2
with:
flutter-version: '2.5.3'
- run: flutter pub get
- run: flutter test
- run: flutter build ios --release --no-codesign
```
Build for the web:
```yaml
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v2
with:
flutter-version: '2.5.3'
- run: flutter pub get
- run: flutter test
- run: flutter build web
```
Build for Windows:
```yaml
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v2
with:
channel: beta
- run: flutter config --enable-windows-desktop
- run: flutter build windows
```
Build for Linux desktop:
```yaml
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v2
with:
channel: beta
- run: |
sudo apt-get update -y
sudo apt-get install -y ninja-build libgtk-3-dev
- run: flutter config --enable-linux-desktop
- run: flutter build linux
```
Build for macOS desktop:
```yaml
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v2
with:
channel: beta
- run: flutter config --enable-macos-desktop
- run: flutter build macos
```
Integration with `actions/cache`:
```yaml
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v2
with:
flutter-version: 2.5.0
channel: stable
cache: true
cache-key: flutter # optional, change this to force refresh cache
cache-path: ${{ runner.tool_cache }}/flutter # optional, change this to specify the cache path
- run: flutter --version
```

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

View File

@@ -1,109 +0,0 @@
import io = require('@actions/io');
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';
function osName(): string {
switch (process.platform) {
case 'win32':
return 'windows';
case 'darwin':
return 'macos';
default:
return process.platform;
}
}
describe('installer tests', () => {
beforeAll(async () => {
await io.rmRF(toolDir);
await io.rmRF(tempDir);
}, 300000);
afterAll(async () => {
try {
await io.rmRF(toolDir);
await io.rmRF(tempDir);
} catch {
console.log('Failed to remove test directories');
}
}, 100000);
it('Downloads flutter', async () => {
await installer.getFlutter('1.0.0', 'stable');
const sdkDir = path.join(toolDir, 'flutter', '1.0.0-stable', 'x64');
expect(fs.existsSync(`${sdkDir}.complete`)).toBe(true);
expect(fs.existsSync(path.join(sdkDir, 'bin'))).toBe(true);
}, 100000);
it('Downloads flutter from beta channel', async () => {
await installer.getFlutter('1.8.3', 'beta');
const sdkDir = path.join(toolDir, 'flutter', '1.8.3-beta', 'x64');
expect(fs.existsSync(`${sdkDir}.complete`)).toBe(true);
expect(fs.existsSync(path.join(sdkDir, 'bin'))).toBe(true);
}, 100000);
describe('get the latest release of a flutter version', () => {
beforeEach(() => {
const platform = osName();
nock('https://storage.googleapis.com', {allowUnmocked: true})
.get(`/flutter_infra/releases/releases_${platform}.json`)
.replyWithFile(200, path.join(dataDir, `releases_${platform}.json`));
});
afterEach(() => {
nock.cleanAll();
nock.enableNetConnect();
});
it('Downloads latest flutter release from stable channel', async () => {
await installer.getFlutter('', 'stable');
const sdkDir = path.join(
toolDir,
'flutter',
'1.7.8-hotfix.4-stable',
'x64'
);
expect(fs.existsSync(`${sdkDir}.complete`)).toBe(true);
expect(fs.existsSync(path.join(sdkDir, 'bin'))).toBe(true);
}, 200000);
it('Downloads latest flutter release of 1.7 when using version 1.7 from dev channel', async () => {
await installer.getFlutter('1.7', 'dev');
const sdkDir = path.join(toolDir, 'flutter', '1.7.11-dev', 'x64');
expect(fs.existsSync(`${sdkDir}.complete`)).toBe(true);
expect(fs.existsSync(path.join(sdkDir, 'bin'))).toBe(true);
}, 200000);
it('Downloads latest flutter release of 1.7 when using version 1.7.x from dev channel', async () => {
await installer.getFlutter('1.7.x', 'dev');
const sdkDir = path.join(toolDir, 'flutter', '1.7.11-dev', 'x64');
expect(fs.existsSync(`${sdkDir}.complete`)).toBe(true);
expect(fs.existsSync(path.join(sdkDir, 'bin'))).toBe(true);
}, 200000);
});
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);
});
});

View File

@@ -1,6 +1,9 @@
name: 'Flutter action'
description: 'Setup your runner with Flutter environment'
author: 'Alif Rachmawadi'
branding:
icon: 'maximize'
color: 'blue'
inputs:
flutter-version:
description: 'The Flutter version to make available on the path'
@@ -9,9 +12,24 @@ inputs:
description: 'The Flutter build release channel'
required: false
default: 'stable'
cache:
description: 'Cache the Flutter SDK'
required: false
cache-key:
description: 'Identifier for the Flutter SDK cache'
required: false
default: 'flutter'
cache-path:
description: 'Flutter SDK cache path'
required: false
default: ${{ runner.tool_cache }}/flutter
runs:
using: 'node12'
main: 'dist/index.js'
branding:
icon: 'maximize'
color: 'blue'
using: 'composite'
steps:
- if: ${{ inputs.cache == 'true' }}
uses: actions/cache@v2
with:
path: ${{ inputs.cache-path }}
key: ${{ inputs.cache-key }}-${{ inputs.channel }}-${{ inputs.flutter-version }}
- run: $GITHUB_ACTION_PATH/setup.sh -c "${{ inputs.cache-path }}" ${{ inputs.channel }} ${{ inputs.flutter-version }}
shell: bash

6718
dist/index.js vendored

File diff suppressed because it is too large Load Diff

View File

@@ -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
}

6232
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,51 +0,0 @@
{
"name": "flutter-action",
"version": "1.2.0",
"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.2.3",
"@actions/exec": "^1.0.3",
"@actions/http-client": "^1.0.6",
"@actions/io": "^1.0.2",
"@actions/tool-cache": "^1.3.1",
"semver": "^7.1.3",
"uuid": "^7.0.1"
},
"devDependencies": {
"@types/jest": "^25.1.3",
"@types/nock": "^10.0.3",
"@types/node": "^12.12.29",
"@types/semver": "^7.1.0",
"@types/uuid": "^7.0.0",
"@zeit/ncc": "^0.21.1",
"jest": "^25.1.0",
"jest-circus": "^25.1.0",
"nock": "^10.0.6",
"npm-run-all": "^4.1.5",
"prettier": "^1.19.1",
"ts-jest": "^25.2.1",
"typescript": "^3.8.3"
}
}

116
setup.sh Executable file
View File

@@ -0,0 +1,116 @@
#!/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 -q -o "$archive_local" -d "$HOME"
shopt -s dotglob
mv ${HOME}/flutter/* "$2"
shopt -u dotglob
else
tar xf "$archive_local" -C "$2" --strip-components=1
fi
rm $archive_local
}
transform_path() {
if [[ $OS_NAME == windows ]]; then
echo $1 | sed -e 's/^\///' -e 's/\//\\/g'
else
echo $1
fi
}
SDK_CACHE=""
while getopts 'c:' flag; do
case "${flag}" in
c) SDK_CACHE="$(transform_path $OPTARG)" ;;
?) exit 2 ;;
esac
done
CHANNEL="${@:$OPTIND:1}"
VERSION="${@:$OPTIND+1:1}"
if [[ $OS_NAME == windows ]]; then
PUB_CACHE="${USERPROFILE}\\.pub-cache"
else
PUB_CACHE="${HOME}/.pub-cache"
fi
mkdir -p "$SDK_CACHE"
if [[ ! -x "${SDK_CACHE}/bin/flutter" ]]; then
if [[ $CHANNEL == master ]]; then
git clone -b master https://github.com/flutter/flutter.git "$SDK_CACHE"
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" "$SDK_CACHE"
fi
fi
echo "FLUTTER_ROOT=${SDK_CACHE}" >>$GITHUB_ENV
echo "PUB_CACHE=${PUB_CACHE}" >>$GITHUB_ENV
echo "${SDK_CACHE}/bin" >>$GITHUB_PATH
echo "${SDK_CACHE}/bin/cache/dart-sdk/bin" >>$GITHUB_PATH
echo "${PUB_CACHE}/bin" >>$GITHUB_PATH

View File

@@ -1,15 +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';
await installer.getFlutter(version, channel);
} catch (error) {
core.setFailed(error.message);
}
}
run();

View File

@@ -1,211 +0,0 @@
import * as core from '@actions/core';
import * as io from '@actions/io';
import * as tc from '@actions/tool-cache';
import * as fs from 'fs';
import * as path from 'path';
import * as httpm from '@actions/http-client';
import * as semver from 'semver';
const IS_WINDOWS = process.platform === 'win32';
const IS_DARWIN = process.platform === 'darwin';
const IS_LINUX = process.platform === 'linux';
const storageUrl = 'https://storage.googleapis.com/flutter_infra/releases';
let tempDirectory = process.env['RUNNER_TEMP'] || '';
if (!tempDirectory) {
let baseLocation;
if (IS_WINDOWS) {
baseLocation = process.env['USERPROFILE'] || 'C:\\';
} else {
if (process.platform === 'darwin') {
baseLocation = '/Users';
} else {
baseLocation = '/home';
}
}
tempDirectory = path.join(baseLocation, 'actions', 'temp');
}
export async function getFlutter(
version: string,
channel: string
): Promise<void> {
const versionPart = version.split('.');
if (versionPart[1] == null || versionPart[2] == null) {
version = version.concat('.x');
}
version = await determineVersion(version, channel);
let cleanver = `${version.replace('+', '-')}-${channel}`;
let toolPath = tc.find('flutter', cleanver);
if (toolPath) {
core.debug(`Tool found in cache ${toolPath}`);
} else {
core.debug('Downloading Flutter from Google storage');
const downloadInfo = getDownloadInfo(version, channel);
const sdkFile = await tc.downloadTool(downloadInfo.url);
let tempDir: string = generateTempDir();
const sdkDir = await extractDownload(sdkFile, tempDir);
core.debug(`Flutter sdk extracted to ${sdkDir}`);
toolPath = await tc.cacheDir(sdkDir, 'flutter', cleanver);
}
core.exportVariable('FLUTTER_HOME', toolPath);
core.addPath(path.join(toolPath, 'bin'));
}
function osName(): string {
if (IS_DARWIN) return 'macos';
if (IS_WINDOWS) return 'windows';
return process.platform;
}
function extName(): string {
if (IS_LINUX) return 'tar.xz';
return 'zip';
}
function getDownloadInfo(
version: string,
channel: string
): {version: string; url: string} {
const os = osName();
const ext = extName();
const url = `${storageUrl}/${channel}/${os}/flutter_${os}_v${version}-${channel}.${ext}`;
return {
version,
url
};
}
function generateTempDir(): string {
return path.join(
tempDirectory,
'temp_' + Math.floor(Math.random() * 2000000000)
);
}
async function extractDownload(
sdkFile: string,
destDir: string
): Promise<string> {
await io.mkdirP(destDir);
const sdkPath = path.normalize(sdkFile);
const stats = fs.statSync(sdkPath);
if (stats.isFile()) {
await extractFile(sdkFile, destDir);
const sdkDir = path.join(destDir, fs.readdirSync(destDir)[0]);
return sdkDir;
} else {
throw new Error(`Flutter sdk argument ${sdkFile} is not a file`);
}
}
async function extractFile(file: string, destDir: string): Promise<void> {
const stats = fs.statSync(file);
if (!stats) {
throw new Error(`Failed to extract ${file} - it doesn't exist`);
} else if (stats.isDirectory()) {
throw new Error(`Failed to extract ${file} - it is a directory`);
}
if ('tar.xz' === extName()) {
await tc.extractTar(file, destDir, 'x');
} else {
await tc.extractZip(file, destDir);
}
}
async function determineVersion(
version: string,
channel: string
): Promise<string> {
if (version.endsWith('.x') || version === '') {
return await getLatestVersion(version, channel);
}
return version;
}
interface IFlutterChannel {
[key: string]: string;
beta: string;
dev: string;
stable: string;
}
interface IFlutterRelease {
hash: string;
channel: string;
version: string;
}
interface IFlutterStorage {
current_release: IFlutterChannel;
releases: IFlutterRelease[];
}
async function getLatestVersion(
version: string,
channel: string
): Promise<string> {
const releasesUrl: string = `${storageUrl}/releases_${osName()}.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 latest version');
}
if (version.endsWith('.x')) {
const sver = version.slice(0, version.length - 2);
const releases = storage.releases.filter(
release =>
release.version.startsWith(`v${sver}`) && release.channel === channel
);
const versions = releases.map(release =>
release.version.slice(1, release.version.length)
);
const sortedVersions = versions.sort(semver.rcompare);
core.debug(
`latest version of ${version} from channel ${channel} is ${sortedVersions[0]}`
);
return sortedVersions[0];
}
const channelVersion = storage.releases.find(
release => release.hash === storage.current_release[channel]
);
if (!channelVersion) {
throw new Error(`unable to get latest version from channel ${channel}`);
}
let cver = channelVersion.version;
cver = cver.slice(1, cver.length);
core.debug(`latest version from channel ${channel} is ${cver}`);
return cver;
}

View File

@@ -1,11 +0,0 @@
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"outDir": "./lib",
"rootDir": "./src",
"strict": true,
"esModuleInterop": true
},
"exclude": ["node_modules", "**/*.test.ts"]
}