@@ -33,16 +33,16 @@ def initialize(checksum:, path:, platform:)
33
33
def upload_github_asset ( octokit , release )
34
34
puts "uploading #{ @path } ..."
35
35
asset = octokit . upload_asset (
36
- release . url ,
37
- @path ,
36
+ release . url ,
37
+ @path ,
38
38
content_type : 'application/gzip' ,
39
- query : { label : artifact [ : platform] }
39
+ query : { label : @ platform }
40
40
)
41
41
puts asset . url
42
42
end
43
43
44
44
def upload_lambda_layer ( aws )
45
- return unless lambda_arch = LAMBDA_PLATFORMS [ @platform ]
45
+ return unless ( lambda_arch = LAMBDA_PLATFORMS [ @platform ] )
46
46
47
47
require 'zip'
48
48
require 'rubygems/package'
@@ -58,11 +58,11 @@ def upload_lambda_layer(aws)
58
58
FileUtils . mkdir_p ( binary_dir )
59
59
60
60
# 1 - unarchive
61
- Gem ::Package :: new ( "" ) . extract_tar_gz ( File . open ( @path , "rb" ) , binary_dir )
61
+ Gem ::Package . new ( '' ) . extract_tar_gz ( File . open ( @path , 'rb' ) , binary_dir )
62
62
63
- list = Dir [ File . join ( binary_dir , "*" ) ]
63
+ list = Dir [ File . join ( binary_dir , '*' ) ]
64
64
65
- if list != [ File . join ( binary_dir , " skylight" ) ]
65
+ if list != [ File . join ( binary_dir , ' skylight' ) ]
66
66
raise "expected to find one skylight binary but found #{ list . inspect } "
67
67
end
68
68
@@ -133,7 +133,7 @@ def download_artifact(platform:, checksum:, version: VERSION, base_url: BASE_URL
133
133
artifacts << download_artifact ( platform : platform , checksum : checksum )
134
134
end
135
135
136
- LAMBDA_PLATFORMS = { " x86_64-linux" => " x86_64" , " aarch64-linux" => " arm64" } . freeze
136
+ LAMBDA_PLATFORMS = { ' x86_64-linux' => ' x86_64' , ' aarch64-linux' => ' arm64' } . freeze
137
137
138
138
aws = Aws ::Lambda ::Client . new
139
139
# do this first to get the ARNs
@@ -144,11 +144,11 @@ def download_artifact(platform:, checksum:, version: VERSION, base_url: BASE_URL
144
144
octokit = Octokit ::Client . new ( access_token : TOKEN )
145
145
puts 'creating release...'
146
146
release = octokit . create_release (
147
- REPO ,
147
+ REPO ,
148
148
VERSION ,
149
- name : "Skylight for OTLP #{ VERSION } " ,
150
- target_commitish : 'main' ,
151
- draft : true ,
149
+ name : "Skylight for OTLP #{ VERSION } " ,
150
+ target_commitish : 'main' ,
151
+ draft : true ,
152
152
prerelease : true ,
153
153
# TODO: better formatting
154
154
body : artifacts . map ( &:layer_version_arn ) . compact . join ( "\n " )
0 commit comments