tebako 0.12.16 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/CMakeLists.txt +2 -2
  3. data/CODE_OF_CONDUCT.adoc +128 -0
  4. data/CONTRIBUTING.adoc +294 -0
  5. data/Gemfile +1 -1
  6. data/INSTALLATION.adoc +231 -0
  7. data/LICENSE.md +33 -0
  8. data/README.adoc +291 -486
  9. data/Rakefile +1 -1
  10. data/cmake/copy_dir.cmake +1 -1
  11. data/common.env +1 -1
  12. data/exe/tebako +1 -1
  13. data/exe/tebako-packager +1 -1
  14. data/include/tebako/tebako-fs.h +1 -1
  15. data/include/tebako/tebako-main.h +1 -1
  16. data/lib/tebako/build_helpers.rb +1 -1
  17. data/lib/tebako/cache_manager.rb +1 -1
  18. data/lib/tebako/cli.rb +1 -1
  19. data/lib/tebako/cli_helpers.rb +1 -1
  20. data/lib/tebako/codegen.rb +1 -1
  21. data/lib/tebako/deploy_helper.rb +8 -7
  22. data/lib/tebako/error.rb +1 -1
  23. data/lib/tebako/options_manager.rb +1 -1
  24. data/lib/tebako/package_descriptor.rb +1 -1
  25. data/lib/tebako/packager/pass1_patch.rb +1 -1
  26. data/lib/tebako/packager/pass1a_patch.rb +1 -1
  27. data/lib/tebako/packager/pass2_patch.rb +1 -1
  28. data/lib/tebako/packager/pass2_patch_crt.rb +1 -1
  29. data/lib/tebako/packager/pass2msys_patch.rb +1 -1
  30. data/lib/tebako/packager/patch.rb +1 -1
  31. data/lib/tebako/packager/patch_buildsystem.rb +1 -1
  32. data/lib/tebako/packager/patch_helpers.rb +1 -1
  33. data/lib/tebako/packager/patch_libraries.rb +1 -1
  34. data/lib/tebako/packager/patch_literals.rb +1 -1
  35. data/lib/tebako/packager/patch_main.rb +1 -1
  36. data/lib/tebako/packager/rubygems_patch.rb +1 -1
  37. data/lib/tebako/packager.rb +1 -1
  38. data/lib/tebako/packager_lite.rb +1 -1
  39. data/lib/tebako/ruby_builder.rb +1 -1
  40. data/lib/tebako/ruby_version.rb +3 -2
  41. data/lib/tebako/scenario_manager.rb +1 -1
  42. data/lib/tebako/stripper.rb +1 -1
  43. data/lib/tebako/version.rb +2 -2
  44. data/lib/tebako.rb +1 -1
  45. data/src/tebako-main.cpp +1 -1
  46. data/tebako.gemspec +1 -1
  47. data/tools/.github/workflows/build-containers.yml +190 -0
  48. data/tools/.github/workflows/lint.yml +3 -3
  49. data/tools/.github/workflows/test.yml +150 -11
  50. data/tools/ci-scripts/arm-brew-install.sh +1 -1
  51. data/tools/ci-scripts/arm-brew-setup.sh +1 -1
  52. data/tools/ci-scripts/level-up.sh +1 -1
  53. data/tools/ci-scripts/patch-fbthrift.sh +1 -1
  54. data/tools/ci-scripts/patch-folly.sh +2 -2
  55. data/tools/ci-scripts/tools.sh +1 -1
  56. data/tools/ci-scripts/x86-brew-install.sh +1 -1
  57. data/tools/ci-scripts/x86-brew-setup.sh +1 -1
  58. data/tools/cmake-scripts/def-external-project.cmake +1 -1
  59. data/tools/cmake-scripts/macos-environment.cmake +2 -2
  60. data/tools/cmake-scripts/msys-environment.cmake +1 -1
  61. data/tools/cmake-scripts/setup-libarchive.cmake +1 -1
  62. data/tools/cmake-scripts/setup-libfmt.cmake +1 -1
  63. data/tools/cmake-scripts/setup-libhowardhinnerdate.cmake +1 -1
  64. data/tools/cmake-scripts/setup-libutfcpp.cmake +2 -2
  65. data/tools/cmake-scripts/setup-openssl-1.1.1.cmake +1 -1
  66. data/tools/docker/alpine-3.17-dev.Dockerfile +49 -0
  67. data/tools/docker/tools/tools.sh +66 -0
  68. data/tools/docker/ubuntu-20.04-dev.Dockerfile +51 -0
  69. data/tools/dwarfs-test-helper/CMakeLists.txt +1 -1
  70. data/tools/include/pro-statvfs.h +1 -1
  71. data/tools/tests/cmake/CMakeLists.txt +1 -1
  72. data/tools/tests/setup-libfmt/CMakeLists.txt +1 -1
  73. data/tools/tests/setup-libhowardhinnerdate/CMakeLists.txt +1 -1
  74. data/tools/tests/setup-librachive/CMakeLists.txt +1 -1
  75. data/tools/tests/setup-libutfcpp/CMakeLists.txt +1 -1
  76. data/tools/tests/setup-openssl/CMakeLists.txt +1 -1
  77. metadata +10 -2
data/Rakefile CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Copyright (c) 2023-2024 [Ribose Inc](https://www.ribose.com).
4
4
  # All rights reserved.
5
- # This file is a part of tebako
5
+ # This file is a part of the Tebako project.
6
6
  #
7
7
  # Redistribution and use in source and binary forms, with or without
8
8
  # modification, are permitted provided that the following conditions
data/cmake/copy_dir.cmake CHANGED
@@ -1,6 +1,6 @@
1
1
  # Copyright (c) 2021, [Ribose Inc](https://www.ribose.com).
2
2
  # All rights reserved.
3
- # This file is a part of tebako
3
+ # This file is a part of the Tebako project.
4
4
  #
5
5
  # Redistribution and use in source and binary forms, with or without
6
6
  # modification, are permitted provided that the following conditions
data/common.env CHANGED
@@ -1,5 +1,5 @@
1
1
  BUILD_TYPE=Release
2
2
  DEPS=deps
3
3
  INCBIN_TAG=348e36b
4
- DWARFS_WR_TAG=v0.9.7
4
+ DWARFS_WR_TAG=v0.10.1
5
5
  RUBY_VER=3.3.7
data/exe/tebako CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  # Copyright (c) 2023 [Ribose Inc](https://www.ribose.com).
5
5
  # All rights reserved.
6
- # This file is a part of tebako
6
+ # This file is a part of the Tebako project.
7
7
  #
8
8
  # Redistribution and use in source and binary forms, with or without
9
9
  # modification, are permitted provided that the following conditions
data/exe/tebako-packager CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  # Copyright (c) 2023-2024 [Ribose Inc](https://www.ribose.com).
5
5
  # All rights reserved.
6
- # This file is a part of tebako
6
+ # This file is a part of the Tebako project.
7
7
  #
8
8
  # Redistribution and use in source and binary forms, with or without
9
9
  # modification, are permitted provided that the following conditions
@@ -2,7 +2,7 @@
2
2
  *
3
3
  * Copyright (c) 2021-2024, [Ribose Inc](https://www.ribose.com).
4
4
  * All rights reserved.
5
- * This file is a part of tebako
5
+ * This file is a part of the Tebako project.
6
6
  *
7
7
  * Redistribution and use in source and binary forms, with or without
8
8
  * modification, are permitted provided that the following conditions
@@ -2,7 +2,7 @@
2
2
  *
3
3
  * Copyright (c) 2021-2024, [Ribose Inc](https://www.ribose.com).
4
4
  * All rights reserved.
5
- * This file is a part of tebako
5
+ * This file is a part of the Tebako project.
6
6
  *
7
7
  * Redistribution and use in source and binary forms, with or without
8
8
  * modification, are permitted provided that the following conditions
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Copyright (c) 2023-2024 [Ribose Inc](https://www.ribose.com).
4
4
  # All rights reserved.
5
- # This file is a part of tebako
5
+ # This file is a part of the Tebako project.
6
6
  #
7
7
  # Redistribution and use in source and binary forms, with or without
8
8
  # modification, are permitted provided that the following conditions
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Copyright (c) 2024 [Ribose Inc](https://www.ribose.com).
4
4
  # All rights reserved.
5
- # This file is a part of tebako
5
+ # This file is a part of the Tebako project.
6
6
  #
7
7
  # Redistribution and use in source and binary forms, with or without
8
8
  # modification, are permitted provided that the following conditions
data/lib/tebako/cli.rb CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  # Copyright (c) 2021-2023 [Ribose Inc](https://www.ribose.com).
5
5
  # All rights reserved.
6
- # This file is a part of tebako
6
+ # This file is a part of the Tebako project.
7
7
  #
8
8
  # Redistribution and use in source and binary forms, with or without
9
9
  # modification, are permitted provided that the following conditions
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Copyright (c) 2023-2025 [Ribose Inc](https://www.ribose.com).
4
4
  # All rights reserved.
5
- # This file is a part of tebako
5
+ # This file is a part of the Tebako project.
6
6
  #
7
7
  # Redistribution and use in source and binary forms, with or without
8
8
  # modification, are permitted provided that the following conditions
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Copyright (c) 2024 [Ribose Inc](https://www.ribose.com).
4
4
  # All rights reserved.
5
- # This file is a part of tebako
5
+ # This file is a part of the Tebako project.
6
6
  #
7
7
  # Redistribution and use in source and binary forms, with or without
8
8
  # modification, are permitted provided that the following conditions
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Copyright (c) 2024 [Ribose Inc](https://www.ribose.com).
4
4
  # All rights reserved.
5
- # This file is a part of tebako
5
+ # This file is a part of the Tebako project.
6
6
  #
7
7
  # Redistribution and use in source and binary forms, with or without
8
8
  # modification, are permitted provided that the following conditions
@@ -110,12 +110,13 @@ module Tebako
110
110
  private
111
111
 
112
112
  def bundle_config
113
- BuildHelpers.run_with_capture_v([@bundler_command, bundler_reference, "config", "set", "--local", "build.ffi",
114
- "--disable-system-libffi"])
115
- BuildHelpers.run_with_capture_v([@bundler_command, bundler_reference, "config",
116
- "set", "--local", "build.nokogiri", @nokogiri_option])
117
- BuildHelpers.run_with_capture_v([@bundler_command, bundler_reference, "config",
118
- "set", "--local", "force_ruby_platform", @force_ruby_platform])
113
+ bundle_config_option(["build.ffi", "--disable-system-libffi"])
114
+ bundle_config_option(["build.nokogiri", @nokogiri_option])
115
+ bundle_config_option(["force_ruby_platform", @force_ruby_platform])
116
+ end
117
+
118
+ def bundle_config_option(opt)
119
+ BuildHelpers.run_with_capture_v([@bundler_command, bundler_reference, "config", "set", "--local"] + opt)
119
120
  end
120
121
 
121
122
  def check_entry_point(entry_point_root)
data/lib/tebako/error.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Copyright (c) 2023-2025 [Ribose Inc](https://www.ribose.com).
4
4
  # All rights reserved.
5
- # This file is a part of tebako
5
+ # This file is a part of the Tebako project.
6
6
  #
7
7
  # Redistribution and use in source and binary forms, with or without
8
8
  # modification, are permitted provided that the following conditions
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Copyright (c) 2023-2025 [Ribose Inc](https://www.ribose.com).
4
4
  # All rights reserved.
5
- # This file is a part of tebako
5
+ # This file is a part of the Tebako project.
6
6
  #
7
7
  # Redistribution and use in source and binary forms, with or without
8
8
  # modification, are permitted provided that the following conditions
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Copyright (c) 2023-2024 [Ribose Inc](https://www.ribose.com).
4
4
  # All rights reserved.
5
- # This file is a part of tebako
5
+ # This file is a part of the Tebako project.
6
6
  #
7
7
  # Redistribution and use in source and binary forms, with or without
8
8
  # modification, are permitted provided that the following conditions
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Copyright (c) 2021-2025 [Ribose Inc](https://www.ribose.com).
4
4
  # All rights reserved.
5
- # This file is a part of tebako
5
+ # This file is a part of the Tebako project.
6
6
  #
7
7
  # Redistribution and use in source and binary forms, with or without
8
8
  # modification, are permitted provided that the following conditions
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Copyright (c) 2024-2025 [Ribose Inc](https://www.ribose.com).
4
4
  # All rights reserved.
5
- # This file is a part of tebako
5
+ # This file is a part of the Tebako project.
6
6
  #
7
7
  # Redistribution and use in source and binary forms, with or without
8
8
  # modification, are permitted provided that the following conditions
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Copyright (c) 2021-2025 [Ribose Inc](https://www.ribose.com).
4
4
  # All rights reserved.
5
- # This file is a part of tebako
5
+ # This file is a part of the Tebako project.
6
6
  #
7
7
  # Redistribution and use in source and binary forms, with or without
8
8
  # modification, are permitted provided that the following conditions
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Copyright (c) 2021-2025 [Ribose Inc](https://www.ribose.com).
4
4
  # All rights reserved.
5
- # This file is a part of tebako
5
+ # This file is a part of the Tebako project.
6
6
  #
7
7
  # Redistribution and use in source and binary forms, with or without
8
8
  # modification, are permitted provided that the following conditions
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Copyright (c) 2021-2025 [Ribose Inc](https://www.ribose.com).
4
4
  # All rights reserved.
5
- # This file is a part of tebako
5
+ # This file is a part of the Tebako project.
6
6
  #
7
7
  # Redistribution and use in source and binary forms, with or without
8
8
  # modification, are permitted provided that the following conditions
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Copyright (c) 2025 [Ribose Inc](https://www.ribose.com).
4
4
  # All rights reserved.
5
- # This file is a part of tebako
5
+ # This file is a part of the Tebako project.
6
6
  #
7
7
  # Redistribution and use in source and binary forms, with or without
8
8
  # modification, are permitted provided that the following conditions
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Copyright (c) 2023-2024 [Ribose Inc](https://www.ribose.com).
4
4
  # All rights reserved.
5
- # This file is a part of tebako
5
+ # This file is a part of the Tebako project.
6
6
  #
7
7
  # Redistribution and use in source and binary forms, with or without
8
8
  # modification, are permitted provided that the following conditions
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Copyright (c) 2023-2024 [Ribose Inc](https://www.ribose.com).
4
4
  # All rights reserved.
5
- # This file is a part of tebako
5
+ # This file is a part of the Tebako project.
6
6
  #
7
7
  # Redistribution and use in source and binary forms, with or without
8
8
  # modification, are permitted provided that the following conditions
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Copyright (c) 2021-2024 [Ribose Inc](https://www.ribose.com).
4
4
  # All rights reserved.
5
- # This file is a part of tebako
5
+ # This file is a part of the Tebako project.
6
6
  #
7
7
  # Redistribution and use in source and binary forms, with or without
8
8
  # modification, are permitted provided that the following conditions
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Copyright (c) 2023-2025 [Ribose Inc](https://www.ribose.com).
4
4
  # All rights reserved.
5
- # This file is a part of tebako
5
+ # This file is a part of the Tebako project.
6
6
  #
7
7
  # Redistribution and use in source and binary forms, with or without
8
8
  # modification, are permitted provided that the following conditions
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Copyright (c) 2023-2024 [Ribose Inc](https://www.ribose.com).
4
4
  # All rights reserved.
5
- # This file is a part of tebako
5
+ # This file is a part of the Tebako project.
6
6
  #
7
7
  # Redistribution and use in source and binary forms, with or without
8
8
  # modification, are permitted provided that the following conditions
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Copyright (c) 2024-2025 [Ribose Inc](https://www.ribose.com).
4
4
  # All rights reserved.
5
- # This file is a part of tebako
5
+ # This file is a part of the Tebako project.
6
6
  #
7
7
  # Redistribution and use in source and binary forms, with or without
8
8
  # modification, are permitted provided that the following conditions
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Copyright (c) 2021-2025 [Ribose Inc](https://www.ribose.com).
4
4
  # All rights reserved.
5
- # This file is a part of tebako
5
+ # This file is a part of the Tebako project.
6
6
  #
7
7
  # Redistribution and use in source and binary forms, with or without
8
8
  # modification, are permitted provided that the following conditions
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Copyright (c) 2023-2025 [Ribose Inc](https://www.ribose.com).
4
4
  # All rights reserved.
5
- # This file is a part of tebako
5
+ # This file is a part of the Tebako project.
6
6
  #
7
7
  # Redistribution and use in source and binary forms, with or without
8
8
  # modification, are permitted provided that the following conditions
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Copyright (c) 2024-2025 [Ribose Inc](https://www.ribose.com).
4
4
  # All rights reserved.
5
- # This file is a part of tebako
5
+ # This file is a part of the Tebako project.
6
6
  #
7
7
  # Redistribution and use in source and binary forms, with or without
8
8
  # modification, are permitted provided that the following conditions
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Copyright (c) 2023-2024 [Ribose Inc](https://www.ribose.com).
4
4
  # All rights reserved.
5
- # This file is a part of tebako
5
+ # This file is a part of the Tebako project.
6
6
  #
7
7
  # Redistribution and use in source and binary forms, with or without
8
8
  # modification, are permitted provided that the following conditions
@@ -45,7 +45,8 @@ module Tebako
45
45
  "3.3.5" => "3781a3504222c2f26cb4b9eb9c1a12dbf4944d366ce24a9ff8cf99ecbce75196",
46
46
  "3.3.6" => "8dc48fffaf270f86f1019053f28e51e4da4cce32a36760a0603a9aee67d7fd8d",
47
47
  "3.3.7" => "9c37c3b12288c7aec20ca121ce76845be5bb5d77662a24919651aaf1d12c8628",
48
- "3.4.1" => "3d385e5d22d368b064c817a13ed8e3cc3f71a7705d7ed1bae78013c33aa7c87f"
48
+ "3.4.1" => "3d385e5d22d368b064c817a13ed8e3cc3f71a7705d7ed1bae78013c33aa7c87f",
49
+ "3.4.2" => "41328ac21f2bfdd7de6b3565ef4f0dd7543354d37e96f157a1552a6bd0eb364b"
49
50
  }.freeze
50
51
 
51
52
  MIN_RUBY_VERSION_WINDOWS = "3.1.6"
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Copyright (c) 2024-2025 [Ribose Inc](https://www.ribose.com).
4
4
  # All rights reserved.
5
- # This file is a part of tebako
5
+ # This file is a part of the Tebako project.
6
6
  #
7
7
  # Redistribution and use in source and binary forms, with or without
8
8
  # modification, are permitted provided that the following conditions
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Copyright (c) 2024-2025 [Ribose Inc](https://www.ribose.com).
4
4
  # All rights reserved.
5
- # This file is a part of tebako
5
+ # This file is a part of the Tebako project.
6
6
  #
7
7
  # Redistribution and use in source and binary forms, with or without
8
8
  # modification, are permitted provided that the following conditions
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Copyright (c) 2023-2025 [Ribose Inc](https://www.ribose.com).
4
4
  # All rights reserved.
5
- # This file is a part of tebako
5
+ # This file is a part of the Tebako project.
6
6
  #
7
7
  # Redistribution and use in source and binary forms, with or without
8
8
  # modification, are permitted provided that the following conditions
@@ -26,5 +26,5 @@
26
26
  # POSSIBILITY OF SUCH DAMAGE.
27
27
 
28
28
  module Tebako
29
- VERSION = "0.12.16"
29
+ VERSION = "0.13.0"
30
30
  end
data/lib/tebako.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Copyright (c) 2023 [Ribose Inc](https://www.ribose.com).
4
4
  # All rights reserved.
5
- # This file is a part of tebako
5
+ # This file is a part of the Tebako project.
6
6
  #
7
7
  # Redistribution and use in source and binary forms, with or without
8
8
  # modification, are permitted provided that the following conditions
data/src/tebako-main.cpp CHANGED
@@ -2,7 +2,7 @@
2
2
  *
3
3
  * Copyright (c) 2021-2024 [Ribose Inc](https://www.ribose.com).
4
4
  * All rights reserved.
5
- * This file is a part of tebako
5
+ * This file is a part of the Tebako project.
6
6
  *
7
7
  * Redistribution and use in source and binary forms, with or without
8
8
  * modification, are permitted provided that the following conditions
data/tebako.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Copyright (c) 2023 [Ribose Inc](https://www.ribose.com).
4
4
  # All rights reserved.
5
- # This file is a part of tebako
5
+ # This file is a part of the Tebako project.
6
6
  #
7
7
  # Redistribution and use in source and binary forms, with or without
8
8
  # modification, are permitted provided that the following conditions
@@ -0,0 +1,190 @@
1
+ # Copyright (c) 2025, [Ribose Inc](https://www.ribose.com).
2
+ # All rights reserved.
3
+ # This file is a part of the Tebako project.
4
+ #
5
+ # Redistribution and use in source and binary forms, with or without
6
+ # modification, are permitted provided that the following conditions
7
+ # are met:
8
+ # 1. Redistributions of source code must retain the above copyright
9
+ # notice, this list of conditions and the following disclaimer.
10
+ # 2. Redistributions in binary form must reproduce the above copyright
11
+ # notice, this list of conditions and the following disclaimer in the
12
+ # documentation and/or other materials provided with the distribution.
13
+ #
14
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
15
+ # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
16
+ # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17
+ # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS
18
+ # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19
+ # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20
+ # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21
+ # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22
+ # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23
+ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24
+ # POSSIBILITY OF SUCH DAMAGE.
25
+
26
+ name: build-containers
27
+
28
+ on:
29
+ workflow_dispatch:
30
+ inputs:
31
+ next_version:
32
+ description: |
33
+ Next container version: x.y.z or major/minor/patch
34
+ required: true
35
+ default: 'patch'
36
+ push:
37
+ description: |
38
+ Push the container images to the registry
39
+ required: false
40
+ default: 'false'
41
+
42
+ concurrency:
43
+ group: '${{ github.workflow }}-${{ github.job }}-${{ github.head_ref || github.ref_name }}'
44
+ cancel-in-progress: true
45
+
46
+ jobs:
47
+ build-containers:
48
+ name: ${{ matrix.container }} ${{ matrix.architecture.platform }}
49
+ runs-on: ${{ matrix.architecture.host }}
50
+ permissions:
51
+ contents: read
52
+ packages: write
53
+ strategy:
54
+ fail-fast: false
55
+ matrix:
56
+ container:
57
+ - 'ubuntu-20.04-dev'
58
+ - 'alpine-3.17-dev'
59
+ architecture:
60
+ - { host: 'ubuntu-22.04', platform: linux/amd64, suffix: 'x64', suffix2: 'amd64' }
61
+ - { host: 'ubuntu-22.04-arm', platform: linux/arm64, suffix: 'arm64', suffix2: 'arm64' }
62
+
63
+ outputs:
64
+ tags: ${{ steps.meta.outputs.tags }}
65
+
66
+ steps:
67
+ - name: Checkout
68
+ uses: actions/checkout@v4
69
+ with:
70
+ fetch-depth: 0
71
+
72
+ - name: Set GITHUB_REF
73
+ if: github.event_name == 'workflow_dispatch'
74
+ run: |
75
+ if [[ "${{ github.event.inputs.next_version }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
76
+ # Direct version number provided
77
+ VERSION="${{ github.event.inputs.next_version }}"
78
+ echo "Using provided version: $VERSION"
79
+ elif [[ "${{ github.event.inputs.next_version }}" == "major" || "${{ github.event.inputs.next_version }}" == "minor" || "${{ github.event.inputs.next_version }}" == "patch" ]]; then
80
+ # Get latest version tag
81
+ LATEST_TAG=$(git tag --sort=-v:refname | grep -v '\.rc[0-9]\+$' | head -n 1)
82
+ LATEST_VERSION=${LATEST_TAG#v}
83
+
84
+ # Split the version numbers
85
+ IFS='.' read -r MAJOR MINOR PATCH <<< "$LATEST_VERSION"
86
+
87
+ # Calculate the next version based on the increment type
88
+ if [[ "${{ github.event.inputs.next_version }}" == "major" ]]; then
89
+ VERSION="$((MAJOR + 1)).0.0"
90
+ elif [[ "${{ github.event.inputs.next_version }}" == "minor" ]]; then
91
+ VERSION="${MAJOR}.$((MINOR + 1)).0"
92
+ else
93
+ VERSION="${MAJOR}.${MINOR}.$((PATCH + 1))"
94
+ fi
95
+ echo "Calculated next ${{ github.event.inputs.next_version }} version: $VERSION"
96
+ else
97
+ echo "::error::Invalid version format. Please use semantic version (x.y.z) or specify 'major', 'minor', or 'patch'"
98
+ exit 1
99
+ fi
100
+
101
+ TAG="v$VERSION"
102
+ echo "Setting VERSION to $VERSION"
103
+ echo "Setting GITHUB_REF to refs/tags/$TAG"
104
+ echo "GITHUB_REF=refs/tags/$TAG" >> $GITHUB_ENV
105
+ echo "VERSION=$VERSION" >> $GITHUB_ENV
106
+
107
+ - name: Log in to the Container registry
108
+ uses: docker/login-action@v3
109
+ with:
110
+ registry: ghcr.io
111
+ username: ${{ github.repository_owner }}
112
+ password: ${{ secrets.GITHUB_TOKEN }}
113
+
114
+ - name: Docker meta
115
+ id: meta
116
+ uses: docker/metadata-action@v5
117
+ with:
118
+ images: |
119
+ ghcr.io/${{ github.repository_owner }}/tebako-${{ matrix.container }}
120
+ tags: |
121
+ type=semver,pattern={{version}}-${{ matrix.architecture.suffix2 }},value=${{ env.VERSION }}
122
+ type=semver,pattern={{major}}.{{minor}}-${{ matrix.architecture.suffix2 }},value=${{ env.VERSION }}
123
+ type=semver,pattern={{major}}-${{ matrix.architecture.suffix2 }},value=${{ env.VERSION }}
124
+ type=sha,suffix=-${{ matrix.architecture.suffix2 }}
125
+ labels: |
126
+ org.opencontainers.image.vendor=Ribose Inc.
127
+ org.opencontainers.image.licenses=BSD-2-Clause
128
+ org.opencontainers.image.documentation=https://www.tamatebako.org
129
+ org.opencontainers.image.source==${{ github.repositoryUrl }}
130
+ org.opencontainers.image.description=Tebako executable packager ${{ matrix.container }} ${{ matrix.architecture.platform }} development container
131
+ annotations: |
132
+ org.opencontainers.image.licenses=BSD-2-Clause
133
+ org.opencontainers.image.description=Tebako executable packager ${{ matrix.container }} ${{ matrix.architecture.platform }} development container
134
+
135
+ - name: Build and push Docker image
136
+ uses: docker/build-push-action@v6
137
+ with:
138
+ context: docker
139
+ file: docker/${{ matrix.container }}.Dockerfile
140
+ push: ${{ github.event.inputs.push == 'true' }}
141
+ tags: ${{ steps.meta.outputs.tags }}
142
+ labels: ${{ steps.meta.outputs.labels }}
143
+ annotations: ${{ steps.meta.outputs.annotations }}
144
+ platforms: ${{ matrix.architecture.platform }}
145
+ build-args: ARCH=${{ matrix.architecture.suffix }}
146
+
147
+ create-manifests:
148
+ name: Create multiarchitecture manifests for ${{ matrix.container }}
149
+ if: ${{ github.event.inputs.push == 'true' }}
150
+ runs-on: ubuntu-22.04
151
+ needs: build-containers
152
+ permissions:
153
+ contents: read
154
+ packages: write
155
+ strategy:
156
+ fail-fast: false
157
+ matrix:
158
+ container:
159
+ - 'ubuntu-20.04-dev'
160
+ - 'alpine-3.17-dev'
161
+ steps:
162
+ - name: Log in to the Container registry
163
+ uses: docker/login-action@v3
164
+ with:
165
+ registry: ghcr.io
166
+ username: ${{ github.repository_owner }}
167
+ password: ${{ secrets.GITHUB_TOKEN }}
168
+
169
+ - name: Create multiarchitecture manifests and push
170
+ run: |
171
+ for tag in $(echo "${{ needs.build-containers.outputs.tags }}" | tr ',' '\n'); do
172
+ if [[ $tag != *:latest ]]; then
173
+ base_tag=$(echo $tag | sed -E 's/.*:(.*)-(amd64|arm64)/\1/')
174
+ echo "Processing $tag, using base tag $base_tag"
175
+ docker manifest create \
176
+ ghcr.io/${{ github.repository_owner }}/tebako-${{ matrix.container }}:$base_tag \
177
+ --amend ghcr.io/${{ github.repository_owner }}/tebako-${{ matrix.container }}:$base_tag-amd64 \
178
+ --amend ghcr.io/${{ github.repository_owner }}/tebako-${{ matrix.container }}:$base_tag-arm64
179
+ docker manifest push ghcr.io/${{ github.repository_owner }}/tebako-${{ matrix.container }}:$base_tag
180
+
181
+ if [[ $base_tag == sha* ]]; then
182
+ docker manifest push ghcr.io/${{ github.repository_owner }}/tebako-${{ matrix.container }}:$base_tag
183
+ docker manifest create \
184
+ ghcr.io/${{ github.repository_owner }}/tebako-${{ matrix.container }}:latest \
185
+ --amend ghcr.io/${{ github.repository_owner }}/tebako-${{ matrix.container }}:$base_tag-amd64 \
186
+ --amend ghcr.io/${{ github.repository_owner }}/tebako-${{ matrix.container }}:$base_tag-arm64
187
+ docker manifest push ghcr.io/${{ github.repository_owner }}/tebako-${{ matrix.container }}:latest
188
+ fi
189
+ fi
190
+ done
@@ -1,6 +1,6 @@
1
- # Copyright (c) 2022-2024, [Ribose Inc](https://www.ribose.com).
1
+ # Copyright (c) 2022-2025, [Ribose Inc](https://www.ribose.com).
2
2
  # All rights reserved.
3
- # This file is a part of tebako
3
+ # This file is a part of the Tebako project.
4
4
  #
5
5
  # Redistribution and use in source and binary forms, with or without
6
6
  # modification, are permitted provided that the following conditions
@@ -27,7 +27,7 @@ name: lint
27
27
 
28
28
  on:
29
29
  push:
30
- branches: [ master ]
30
+ branches: [ master, main ]
31
31
  pull_request:
32
32
  workflow_dispatch:
33
33