-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
convert the implementation of the action to Dart (#77)
* re-write into Dart * fix http_client interop * update entry-point * refactor dist * more updates * packaging updates * update the developing instructions; add a sig file * fix build script * await a future * use JS types * review comments
- Loading branch information
1 parent
ed899c0
commit 699d685
Showing
29 changed files
with
12,644 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
dist/** -diff linguist-generated=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Validate that the compiled artifacts are up-to-date. | ||
|
||
name: Build | ||
|
||
on: | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./ | ||
with: | ||
sdk: beta | ||
- run: dart pub get | ||
- run: dart tool/sig.dart --verify |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,13 @@ | ||
example/.packages | ||
example/pubspec.lock | ||
example/.dart_tool/ | ||
# Dart files | ||
.dart_tool/ | ||
pubspec.lock | ||
|
||
# node modules | ||
node_modules/ | ||
|
||
# intermediary compilation artifacts | ||
lib/main.js | ||
lib/main.js.deps | ||
lib/main.js.map | ||
|
||
lib/sig.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
[![Build](https://github.com/dart-lang/setup-dart/actions/workflows/build.yml/badge.svg)](https://github.com/dart-lang/setup-dart/actions/workflows/build.yml) | ||
[![Dart](https://github.com/dart-lang/setup-dart/actions/workflows/dart.yml/badge.svg)](https://github.com/dart-lang/setup-dart/actions/workflows/dart.yml) | ||
|
||
## Setting up | ||
|
||
1. Install node | ||
1. Install additional node tooling (`npm i -g @vercel/ncc`) | ||
1. Install the node package dependencies (`npm install`) | ||
|
||
## Development | ||
|
||
tldr: edit Dart source files; run `npm run all` to re-compile the action | ||
|
||
### Working on the action | ||
|
||
Generally, to work on the action, edit the Dart source code in `lib/` and | ||
re-compile the JavaScript code via `npm run all`. This will: | ||
|
||
- compile the Dart source (via dart2js) to `lib/main.js`; copy that file to | ||
`dist/main.cjs` | ||
- package and minify the `lib/main.mjs` entrypoint point and referencd node | ||
modules to `dist/index.mjs` | ||
|
||
### Files | ||
|
||
`lib/main.dart` - the Dart entry-point to the action. | ||
|
||
`lib/main.mjs` - the JavaScript wrapper; this sets up some important JS interop | ||
globals and bootstraps into `lib/main.dart`. | ||
|
||
`dist/index.mjs` - the execution entry-point of the action. | ||
|
||
## Releasing | ||
|
||
See our | ||
[publishing](https://github.com/dart-lang/setup-dart/wiki/Publishing-procedure) | ||
wiki page. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
name: "Setup Dart SDK" | ||
description: "Setup the Dart SDK, and add it to the PATH" | ||
description: "Download and setup the Dart SDK." | ||
branding: | ||
icon: check-circle | ||
color: blue | ||
inputs: | ||
sdk: | ||
description: >- | ||
The channel, or a specific version from a channel to install ('stable', | ||
'beta', 'dev', '2.7.2', '2.12.0-1.4.beta'). Using one of the three | ||
'beta', 'dev', '2.7.2', '2.12.0-1.4.beta'). Using one of the named | ||
channels instead of a version will give you the latest version published | ||
to that channel. | ||
required: false | ||
default: "stable" | ||
architecture: | ||
description: "The CPU architecture ('x64', 'ia32', 'arm', or 'arm64')." | ||
required: false | ||
default: "x64" | ||
flavor: | ||
description: "The build flavor ('raw' or 'release')." | ||
description: "The build flavor ('release' or 'raw')." | ||
required: false | ||
outputs: | ||
dart-version: | ||
description: 'The installed Dart version.' | ||
runs: | ||
using: "composite" | ||
steps: | ||
- run: $GITHUB_ACTION_PATH/setup.sh ${{ inputs.sdk }} ${{ runner.os }} ${{ inputs.architecture }} ${{ inputs.flavor }} | ||
shell: bash | ||
using: "node16" | ||
main: "dist/index.mjs" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
include: package:lints/recommended.yaml | ||
|
||
linter: | ||
rules: | ||
- unawaited_futures |
Oops, something went wrong.