Commit 29bdf22 1 parent bdc320a commit 29bdf22 Copy full SHA for 29bdf22
File tree 3 files changed +20
-7
lines changed
3 files changed +20
-7
lines changed Original file line number Diff line number Diff line change @@ -3,12 +3,24 @@ use crate::{
3
3
bindings:: { Guest , export} ,
4
4
} ;
5
5
6
- pub struct GithubContext { }
6
+ pub struct RunningContext { }
7
7
8
- impl Guest for GithubContext {
8
+ impl Guest for RunningContext {
9
9
fn run_with_config ( config : String ) -> Result < ( ) , GithubError > {
10
- todo ! ( )
10
+ tokio:: runtime:: Builder :: new_current_thread ( ) . enable_all ( ) . build ( ) ?. block_on ( async {
11
+ let ctx = RunningContext { } ;
12
+ ctx. run ( config) . await
13
+ } )
11
14
}
12
15
}
13
16
14
- export ! ( GithubContext with_types_in bindings) ;
17
+ impl RunningContext {
18
+ async fn run ( & self , config : String ) -> Result < ( ) , GithubError > {
19
+ let args = std:: env:: args ( ) ;
20
+ println ! ( "Args: {:?}" , args) ;
21
+ println ! ( "Config: {}" , config) ;
22
+ Ok ( ( ) )
23
+ }
24
+ }
25
+
26
+ export ! ( RunningContext with_types_in bindings) ;
Original file line number Diff line number Diff line change @@ -2,4 +2,4 @@ pub mod bindings;
2
2
mod commands;
3
3
mod errors;
4
4
5
- pub use crate :: { bindings:: GithubError , commands:: GithubContext } ;
5
+ pub use crate :: { bindings:: GithubError , commands:: RunningContext } ;
Original file line number Diff line number Diff line change 8
8
using : node20
9
9
main : rust-publish.js
10
10
env :
11
- GITHUB_TOKEN : As provided by Github Actions
11
+ GITHUB_TOKEN : Secret provided by github.com
12
+ CRATES_TOKEN : Secret provided by crates.io
12
13
inputs :
13
14
config :
14
15
description : Path of the config file
15
16
required : true
16
- default : ' {json} '
17
+ default : .config/rust-publish.toml
17
18
outputs :
18
19
DEPLOYMENT_STATUS :
19
20
description : ' The status of the deployment that indicates if the run failed or passed. Possible outputs include: success|failed|skipped'
You can’t perform that action at this time.
0 commit comments