Skip to content

Commit

Permalink
Merge pull request #22 from tildeio/6.0.0-alpha
Browse files Browse the repository at this point in the history
fix script
  • Loading branch information
zvkemp authored Oct 10, 2024
2 parents 5c62f8c + 22430cd commit e35db97
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/fetch_release.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ def initialize(checksum:, path:, platform:)
def upload_github_asset(octokit, release)
puts "uploading #{@path}..."
asset = octokit.upload_asset(
release.url,
@path,
release.url,
@path,
content_type: 'application/gzip',
query: { label: artifact[:platform] }
query: { label: @platform }
)
puts asset.url
end

def upload_lambda_layer(aws)
return unless lambda_arch = LAMBDA_PLATFORMS[@platform]
return unless (lambda_arch = LAMBDA_PLATFORMS[@platform])

require 'zip'
require 'rubygems/package'
Expand All @@ -58,11 +58,11 @@ def upload_lambda_layer(aws)
FileUtils.mkdir_p(binary_dir)

# 1 - unarchive
Gem::Package::new("").extract_tar_gz(File.open(@path, "rb"), binary_dir)
Gem::Package.new('').extract_tar_gz(File.open(@path, 'rb'), binary_dir)

list = Dir[File.join(binary_dir, "*")]
list = Dir[File.join(binary_dir, '*')]

if list != [File.join(binary_dir, "skylight")]
if list != [File.join(binary_dir, 'skylight')]
raise "expected to find one skylight binary but found #{list.inspect}"
end

Expand Down Expand Up @@ -133,7 +133,7 @@ def download_artifact(platform:, checksum:, version: VERSION, base_url: BASE_URL
artifacts << download_artifact(platform: platform, checksum: checksum)
end

LAMBDA_PLATFORMS = { "x86_64-linux" => "x86_64", "aarch64-linux" => "arm64" }.freeze
LAMBDA_PLATFORMS = { 'x86_64-linux' => 'x86_64', 'aarch64-linux' => 'arm64' }.freeze

aws = Aws::Lambda::Client.new
# do this first to get the ARNs
Expand All @@ -144,11 +144,11 @@ def download_artifact(platform:, checksum:, version: VERSION, base_url: BASE_URL
octokit = Octokit::Client.new(access_token: TOKEN)
puts 'creating release...'
release = octokit.create_release(
REPO,
REPO,
VERSION,
name: "Skylight for OTLP #{VERSION}",
target_commitish: 'main',
draft: true,
name: "Skylight for OTLP #{VERSION}",
target_commitish: 'main',
draft: true,
prerelease: true,
# TODO: better formatting
body: artifacts.map(&:layer_version_arn).compact.join("\n")
Expand Down

0 comments on commit e35db97

Please sign in to comment.