Skip to content

Commit

Permalink
Update to sqlite 3.45.2 (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
copiousfreetime authored Nov 14, 2024
2 parents 7f6603f + e0e8316 commit c1e5eed
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ blocks:
os_image: ubuntu2004
containers:
- name: rake-compiler-dock
image: "larskanis/rake-compiler-dock-mri-x86-mingw32:1.2.2"
image: "ghcr.io/rake-compiler/rake-compiler-dock-image:1.4.0-mri-x86-mingw32"
jobs:
- name: build x86-mingw32 gem
commands:
Expand All @@ -95,7 +95,7 @@ blocks:
os_image: ubuntu2004
containers:
- name: rake-compiler-dock
image: "larskanis/rake-compiler-dock-mri-x64-mingw32:1.2.2"
image: "ghcr.io/rake-compiler/rake-compiler-dock-image:1.4.0-mri-x64-mingw32"
jobs:
- name: build x64-mingw32
commands:
Expand All @@ -115,7 +115,7 @@ blocks:
os_image: ubuntu2004
containers:
- name: rake-compiler-dock
image: "larskanis/rake-compiler-dock-mri-x64-mingw-ucrt:1.2.2"
image: "ghcr.io/rake-compiler/rake-compiler-dock-image:1.4.0-mri-x64-mingw-ucrt"
jobs:
- name: build x64-mingw-ucrt
commands:
Expand Down
4 changes: 3 additions & 1 deletion HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Amalgalite Changelog
## Version 1.9.5 - 2024-03-XX
* Update to SQLite 3.45.2

## VErsion 1.9.4 - 2024-03-03
## Version 1.9.4 - 2024-03-03
* Update to SQLite 3.45.1

## Version 1.9.3 - 2023-12-20
Expand Down
7 changes: 7 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ This.ruby_gemspec do |spec|
spec.license = "BSD-3-Clause"
end

This.cross_platforms = %w[
x86-mingw32
x64-mingw-ucrt
x64-mingw32
]

load 'tasks/default.rake'
load 'tasks/extension.rake'
load 'tasks/custom.rake'
load 'tasks/semaphore.rake'
6 changes: 1 addition & 5 deletions tasks/extension.rake
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ begin
ext.gem_spec = This.ruby_gemspec

ext.cross_compile = true # enable cross compilation (requires cross compile toolchain)
ext.cross_platform = %w[
x86-mingw32
x64-mingw-ucrt
x64-mingw32
]
ext.cross_platform = This.cross_platforms
end

task :test_requirements => :compile
Expand Down
79 changes: 79 additions & 0 deletions tasks/semaphore.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
require 'yaml'
require 'uri'
require 'open-uri'

namespace :semaphore do

def semaphore_config
config_file = File.join(ENV['HOME'], '.sem.yaml')
if File.exist?(config_file)
config = YAML.load_file(config_file)
config.dig('contexts', 'copiousfreetime_semaphoreci_com')
else
nil
end
end

def auth_token
semaphore_config.dig('auth', 'token')
end

def semaphore_endpoint
"https://#{semaphore_config['host']}"
end

def semaphore_api_endpoint
"#{semaphore_endpoint}/api/v1alpha"
end

def project_meta
@project_meta ||= URI.open("#{semaphore_api_endpoint}/projects/#{This.name}",
"Authorization" => "Token #{auth_token}") do |f|
JSON.parse(f.read)
end
end

def project_id
project_meta.dig('metadata', 'id')
end

def artifacts
This.cross_platforms.map do |platform|
name = Gem::NameTuple.new(This.name, This.version, platform)
basename = "#{name.full_name}.gem"
basename
end
end

desc "Dump semaphore config"
task :config do
puts semaphore_config.to_yaml
end

desc "Dump semaphore project meta"
task :meta do
puts JSON.pretty_generate(project_meta)
end

namespace :artifacts do

desc "List artifacts"
task :list do
puts artifacts
end

desc "Download artifacts"
task :download do
artifacts.each do |basename|
url = "#{semaphore_endpoint}/projects/#{project_id}/artifacts/#{basename}"
dest = File.join("pkg", basename)
puts "downloading #{url} => #{dest}"
URI.open(url, "Authorization" => "Token #{auth_token}") do |f|
File.open(dest, "wb") do |out|
out.write(f.read)
end
end
end
end
end
end
3 changes: 3 additions & 0 deletions tasks/this.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ class ThisProject
# The hash of Gem::Specifications keyed' by platform
attr_accessor :gemspecs

# List of cross platforms to build the gem for
attr_accessor :cross_platforms

# Public: Initialize ThisProject
#
# Yields self
Expand Down

0 comments on commit c1e5eed

Please sign in to comment.