From 1c27be28376dc078c4505c9a1e2d20d47784cc0e Mon Sep 17 00:00:00 2001 From: copiousfreetime Date: Sun, 3 Mar 2024 21:15:23 -0700 Subject: [PATCH 1/5] update fixme for cross platform --- tasks/extension.rake | 6 +----- tasks/this.rb | 3 +++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/tasks/extension.rake b/tasks/extension.rake index 5eceb94..aacdc6e 100644 --- a/tasks/extension.rake +++ b/tasks/extension.rake @@ -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 diff --git a/tasks/this.rb b/tasks/this.rb index d62086b..f9e8a19 100644 --- a/tasks/this.rb +++ b/tasks/this.rb @@ -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 From 31d1770a83d4b9523d6707458fe929cbc2bc72da Mon Sep 17 00:00:00 2001 From: copiousfreetime Date: Sun, 3 Mar 2024 21:16:34 -0700 Subject: [PATCH 2/5] download semaphore artifacts --- Rakefile | 7 ++++ tasks/semaphore.rake | 80 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+) create mode 100644 tasks/semaphore.rake diff --git a/Rakefile b/Rakefile index d9618da..06761db 100644 --- a/Rakefile +++ b/Rakefile @@ -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' diff --git a/tasks/semaphore.rake b/tasks/semaphore.rake new file mode 100644 index 0000000..b9033b6 --- /dev/null +++ b/tasks/semaphore.rake @@ -0,0 +1,80 @@ +require 'yaml' +require 'uri' +require 'open-uri' +require 'debug' + +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 From 0dba07a62eeda39813b67d13398c10101f48b207 Mon Sep 17 00:00:00 2001 From: copiousfreetime Date: Sun, 3 Mar 2024 21:26:52 -0700 Subject: [PATCH 3/5] remove debug reference --- tasks/semaphore.rake | 1 - 1 file changed, 1 deletion(-) diff --git a/tasks/semaphore.rake b/tasks/semaphore.rake index b9033b6..252eeff 100644 --- a/tasks/semaphore.rake +++ b/tasks/semaphore.rake @@ -1,7 +1,6 @@ require 'yaml' require 'uri' require 'open-uri' -require 'debug' namespace :semaphore do From b61903b7271292a49699899cbf7b8266f0474998 Mon Sep 17 00:00:00 2001 From: copiousfreetime Date: Mon, 18 Mar 2024 11:07:56 -0600 Subject: [PATCH 4/5] update docker images --- .semaphore/semaphore.yml | 6 +++--- HISTORY.md | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml index a96a8ab..8c71b5a 100644 --- a/.semaphore/semaphore.yml +++ b/.semaphore/semaphore.yml @@ -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: @@ -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: @@ -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-mingw32-ucrt" jobs: - name: build x64-mingw-ucrt commands: diff --git a/HISTORY.md b/HISTORY.md index 64d439b..d617554 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -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 From e0e831647a770626ae04a00fd447c7337ed450da Mon Sep 17 00:00:00 2001 From: copiousfreetime Date: Mon, 18 Mar 2024 11:17:38 -0600 Subject: [PATCH 5/5] fix docker image name --- .semaphore/semaphore.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml index 8c71b5a..f384298 100644 --- a/.semaphore/semaphore.yml +++ b/.semaphore/semaphore.yml @@ -115,7 +115,7 @@ blocks: os_image: ubuntu2004 containers: - name: rake-compiler-dock - image: "ghcr.io/rake-compiler/rake-compiler-dock-image:1.4.0-mri-x64-mingw32-ucrt" + image: "ghcr.io/rake-compiler/rake-compiler-dock-image:1.4.0-mri-x64-mingw-ucrt" jobs: - name: build x64-mingw-ucrt commands: