-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
convert the implementation of the action to Dart #77
Merged
Merged
Changes from 9 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
e6f524e
re-write into Dart
devoncarew 95dc1bc
fix http_client interop
devoncarew c1e20c7
update entry-point
devoncarew 57d7b38
refactor dist
devoncarew 4cd4f62
more updates
devoncarew ca98a97
packaging updates
devoncarew b7e2010
update the developing instructions; add a sig file
devoncarew ca12731
fix build script
devoncarew b73a376
await a future
devoncarew 5d4a0bb
use JS types
devoncarew eb26ba0
review comments
devoncarew File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,34 @@ | ||
## 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, why no package-ecosystem: pub?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ran into some issues when eval'ing it when it was in beta (dependabot/dependabot-core#4979), and was generally waiting for them to be addressed before using the functionality more widely.