emf2svg 1.8.2.2-aarch64-mingw-ucrt
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.
- checksums.yaml +7 -0
- data/.github/workflows/build.yml +254 -0
- data/.github/workflows/release.yml +263 -0
- data/.gitignore +21 -0
- data/.rspec +3 -0
- data/.rubocop.yml +14 -0
- data/CODE_OF_CONDUCT.md +84 -0
- data/Gemfile +14 -0
- data/README.adoc +293 -0
- data/Rakefile +71 -0
- data/bin/console +15 -0
- data/bin/emf2svg +38 -0
- data/bin/setup +8 -0
- data/emf2svg.gemspec +33 -0
- data/exe/emf2svg +38 -0
- data/ext/Makefile +4 -0
- data/ext/extconf.rb +6 -0
- data/lib/emf2svg/emf2svg.dll +0 -0
- data/lib/emf2svg/recipe.rb +283 -0
- data/lib/emf2svg/version.rb +18 -0
- data/lib/emf2svg.rb +71 -0
- metadata +77 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 6697af410696cc06f8f019172ad579531f5282f2d0618ce2809838352b8afa0b
|
|
4
|
+
data.tar.gz: abb3fbc48e9b931ae592edc74a6443ab7d90f978dfa4d9a5942d73a634e7eddb
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 04dcf88878a3154d9c6680d6148ea958942f1ffdde6b594e67ec79445e1213ab2ec2d0f49bf08340ca8f345e3707538f230393da294eb4f99f8948216d1a4786
|
|
7
|
+
data.tar.gz: 2457d47964035a5f3492ba2c4121390c6b4f1ddac36f301e1a0030a64fb770ecfb098a61914d87dac1f887bfde85f574e7fce1bd382d827b0c30c1221b4cb18f
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
name: build
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main ]
|
|
6
|
+
paths-ignore:
|
|
7
|
+
- '*.adoc'
|
|
8
|
+
pull_request:
|
|
9
|
+
workflow_dispatch:
|
|
10
|
+
|
|
11
|
+
concurrency:
|
|
12
|
+
group: '${{ github.workflow }}-${{ github.job }}-${{ github.head_ref || github.ref_name }}'
|
|
13
|
+
cancel-in-progress: true
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
prepare:
|
|
17
|
+
uses: metanorma/ci/.github/workflows/prepare-rake.yml@main
|
|
18
|
+
|
|
19
|
+
test:
|
|
20
|
+
name: Test on Ruby ${{ matrix.ruby.version }} ${{ matrix.os }}
|
|
21
|
+
runs-on: ${{ matrix.os }}
|
|
22
|
+
|
|
23
|
+
needs: prepare
|
|
24
|
+
if: needs.prepare.outputs.push-for-tag != 'true'
|
|
25
|
+
|
|
26
|
+
continue-on-error: ${{ matrix.ruby.experimental }}
|
|
27
|
+
strategy:
|
|
28
|
+
fail-fast: false
|
|
29
|
+
max-parallel: 5
|
|
30
|
+
matrix: ${{ fromJson(needs.prepare.outputs.matrix) }}
|
|
31
|
+
|
|
32
|
+
steps:
|
|
33
|
+
- uses: actions/checkout@v4
|
|
34
|
+
|
|
35
|
+
- uses: ruby/setup-ruby@master
|
|
36
|
+
with:
|
|
37
|
+
bundler-cache: true
|
|
38
|
+
ruby-version: ${{ matrix.ruby.version }}
|
|
39
|
+
rubygems: ${{ matrix.ruby.rubygems }}
|
|
40
|
+
|
|
41
|
+
# https://github.com/microsoft/vcpkg/issues/15931
|
|
42
|
+
# no good solution :(
|
|
43
|
+
- name: Workaround for vcpkg
|
|
44
|
+
if: startsWith(matrix.os, 'ubuntu') || startsWith(matrix.os, 'macos')
|
|
45
|
+
shell: bash
|
|
46
|
+
run: |
|
|
47
|
+
if [[ "$RUNNER_OS" == "Linux" ]]; then
|
|
48
|
+
sudo apt-get update
|
|
49
|
+
sudo apt-get install -y gperf autoconf autoconf-archive automake libtool
|
|
50
|
+
elif [[ "$RUNNER_OS" == "macOS" ]]; then
|
|
51
|
+
brew install gperf autoconf autoconf-archive automake libtool
|
|
52
|
+
fi
|
|
53
|
+
|
|
54
|
+
- run: |
|
|
55
|
+
which make || true
|
|
56
|
+
which clang || true
|
|
57
|
+
which gcc || true
|
|
58
|
+
|
|
59
|
+
- run: bundle exec rake
|
|
60
|
+
|
|
61
|
+
build:
|
|
62
|
+
name: build ${{ matrix.os }}, ${{ matrix.ruby-version }}, ${{ matrix.platform }}
|
|
63
|
+
runs-on: ${{ matrix.os }}
|
|
64
|
+
needs: prepare
|
|
65
|
+
strategy:
|
|
66
|
+
fail-fast: false
|
|
67
|
+
matrix:
|
|
68
|
+
include:
|
|
69
|
+
- os: ubuntu-latest
|
|
70
|
+
platform: any
|
|
71
|
+
ruby-version: ${{ needs.prepare.outputs.default-ruby-version }}
|
|
72
|
+
- os: ubuntu-latest
|
|
73
|
+
platform: x86_64-linux
|
|
74
|
+
ruby-version: ${{ needs.prepare.outputs.default-ruby-version }}
|
|
75
|
+
- os: ubuntu-24.04-arm
|
|
76
|
+
platform: aarch64-linux
|
|
77
|
+
ruby-version: ${{ needs.prepare.outputs.default-ruby-version }}
|
|
78
|
+
- os: windows-latest
|
|
79
|
+
platform: x64-mingw32
|
|
80
|
+
ruby-version: ${{ needs.prepare.outputs.default-ruby-version }}
|
|
81
|
+
- os: windows-latest
|
|
82
|
+
platform: x64-mingw-ucrt
|
|
83
|
+
ruby-version: ${{ needs.prepare.outputs.default-ruby-version }}
|
|
84
|
+
- os: windows-11-arm
|
|
85
|
+
platform: aarch64-mingw-ucrt
|
|
86
|
+
ruby-version: '3.4'
|
|
87
|
+
- os: macos-latest
|
|
88
|
+
platform: arm64-darwin
|
|
89
|
+
ruby-version: ${{ needs.prepare.outputs.default-ruby-version }}
|
|
90
|
+
- os: macos-15-intel
|
|
91
|
+
platform: x86_64-darwin
|
|
92
|
+
ruby-version: ${{ needs.prepare.outputs.default-ruby-version }}
|
|
93
|
+
steps:
|
|
94
|
+
- uses: actions/checkout@v4
|
|
95
|
+
|
|
96
|
+
- name: Setup Ruby
|
|
97
|
+
uses: ruby/setup-ruby@master
|
|
98
|
+
with:
|
|
99
|
+
ruby-version: ${{ matrix.ruby-version }}
|
|
100
|
+
bundler-cache: true
|
|
101
|
+
|
|
102
|
+
- name: Workaround for vcpkg
|
|
103
|
+
if: startsWith(matrix.os, 'ubuntu') || startsWith(matrix.os, 'macos')
|
|
104
|
+
shell: bash
|
|
105
|
+
run: |
|
|
106
|
+
if [[ "$RUNNER_OS" == "Linux" ]]; then
|
|
107
|
+
sudo apt-get update
|
|
108
|
+
sudo apt-get install -y gperf autoconf autoconf-archive automake libtool
|
|
109
|
+
elif [[ "$RUNNER_OS" == "macOS" ]]; then
|
|
110
|
+
brew install gperf autoconf autoconf-archive automake libtool
|
|
111
|
+
fi
|
|
112
|
+
|
|
113
|
+
- run: bundle exec rake gem:native:${{ matrix.platform }}
|
|
114
|
+
|
|
115
|
+
- if: matrix.platform != 'any'
|
|
116
|
+
uses: metanorma/ci/native-deps-action@main
|
|
117
|
+
with:
|
|
118
|
+
libname: emf2svg
|
|
119
|
+
directory: lib/emf2svg
|
|
120
|
+
|
|
121
|
+
- uses: actions/upload-artifact@v4
|
|
122
|
+
with:
|
|
123
|
+
name: pkg-${{ matrix.platform }}
|
|
124
|
+
path: pkg/*.gem
|
|
125
|
+
|
|
126
|
+
# Musl builds run inside an Alpine container so the resulting libs
|
|
127
|
+
# link against musl libc, not the runner's glibc.
|
|
128
|
+
#
|
|
129
|
+
# GitHub Actions does not allow JS-based actions (checkout, upload-
|
|
130
|
+
# artifact, etc.) inside an Alpine container on ARM64 runners
|
|
131
|
+
# (limitation noted at actions/runner#2006). We therefore do the
|
|
132
|
+
# checkout and artifact upload on the host, and run the actual build
|
|
133
|
+
# via `docker run` with the workspace mounted.
|
|
134
|
+
#
|
|
135
|
+
# NOTE: aarch64-linux-musl is intentionally absent. vcpkg has no
|
|
136
|
+
# binary cache for arm64-linux-musl, so first-time builds compile
|
|
137
|
+
# freetype/fontconfig/libxml2/etc. from source on native arm64-musl,
|
|
138
|
+
# which consistently exceeds the 6h job timeout. Re-add once vcpkg
|
|
139
|
+
# publishes arm64-linux-musl binaries or we ship a pre-built Alpine
|
|
140
|
+
# arm64 image with the deps already compiled.
|
|
141
|
+
build-musl:
|
|
142
|
+
name: build-musl ${{ matrix.os }}, ${{ matrix.platform }}
|
|
143
|
+
runs-on: ${{ matrix.os }}
|
|
144
|
+
needs: prepare
|
|
145
|
+
strategy:
|
|
146
|
+
fail-fast: false
|
|
147
|
+
matrix:
|
|
148
|
+
include:
|
|
149
|
+
- os: ubuntu-latest
|
|
150
|
+
platform: x86_64-linux-musl
|
|
151
|
+
steps:
|
|
152
|
+
- uses: actions/checkout@v4
|
|
153
|
+
|
|
154
|
+
- name: Build gem in Alpine container
|
|
155
|
+
env:
|
|
156
|
+
TARGET_PLATFORM: ${{ matrix.platform }}
|
|
157
|
+
run: |
|
|
158
|
+
docker run --rm \
|
|
159
|
+
-v "$PWD:/work" \
|
|
160
|
+
-w /work \
|
|
161
|
+
-e target_platform="${TARGET_PLATFORM}" \
|
|
162
|
+
alpine:3.20 sh -c '
|
|
163
|
+
set -eux
|
|
164
|
+
export VCPKG_FORCE_SYSTEM_BINARIES=1
|
|
165
|
+
apk add --no-cache \
|
|
166
|
+
build-base bash curl git cmake make ninja gcc g++ gperf \
|
|
167
|
+
automake autoconf autoconf-archive libtool linux-headers \
|
|
168
|
+
perl zip unzip tar python3 pkgconfig gcompat argp-standalone \
|
|
169
|
+
ruby ruby-dev ruby-bundler ruby-rake file
|
|
170
|
+
git config --global --add safe.directory /work
|
|
171
|
+
bundle config set --local path vendor/bundle
|
|
172
|
+
bundle install --jobs 4 --retry 3
|
|
173
|
+
bundle exec rake gem:native:"'"${TARGET_PLATFORM}"'"
|
|
174
|
+
'
|
|
175
|
+
|
|
176
|
+
- uses: actions/upload-artifact@v4
|
|
177
|
+
with:
|
|
178
|
+
name: pkg-${{ matrix.platform }}
|
|
179
|
+
path: pkg/*.gem
|
|
180
|
+
|
|
181
|
+
test-build:
|
|
182
|
+
needs: [ prepare, build, build-musl ]
|
|
183
|
+
runs-on: ${{ matrix.os }}
|
|
184
|
+
|
|
185
|
+
continue-on-error: ${{ matrix.ruby.experimental }}
|
|
186
|
+
strategy:
|
|
187
|
+
fail-fast: false
|
|
188
|
+
max-parallel: 5
|
|
189
|
+
matrix: ${{ fromJson(needs.prepare.outputs.matrix) }}
|
|
190
|
+
|
|
191
|
+
steps:
|
|
192
|
+
- uses: actions/checkout@v4
|
|
193
|
+
|
|
194
|
+
- uses: ruby/setup-ruby@master
|
|
195
|
+
with:
|
|
196
|
+
bundler-cache: true
|
|
197
|
+
ruby-version: ${{ matrix.ruby.version }}
|
|
198
|
+
rubygems: ${{ matrix.ruby.rubygems }}
|
|
199
|
+
|
|
200
|
+
- uses: actions/download-artifact@v4
|
|
201
|
+
with:
|
|
202
|
+
pattern: pkg-*
|
|
203
|
+
path: pkg
|
|
204
|
+
merge-multiple: true
|
|
205
|
+
|
|
206
|
+
- name: Install binary gem
|
|
207
|
+
run: gem install -b pkg/emf2svg-$(ruby -I lib -r emf2svg/version -e "puts Emf2svg::VERSION")-$(ruby -e "puts RUBY_PLATFORM.sub(/darwin\d{2}$/, 'darwin')").gem
|
|
208
|
+
# MacOS with have something like arm64-darwin19, others just aarch64-linux
|
|
209
|
+
- name: Test conversion
|
|
210
|
+
run: |
|
|
211
|
+
ruby -remf2svg -e "puts File.write('output.svg', Emf2svg.from_file('spec/examples/image1.emf'), mode: 'wb')"
|
|
212
|
+
|
|
213
|
+
test-build-any:
|
|
214
|
+
needs: [ prepare, build, build-musl ]
|
|
215
|
+
runs-on: ${{ matrix.os }}
|
|
216
|
+
|
|
217
|
+
continue-on-error: ${{ matrix.ruby.experimental }}
|
|
218
|
+
strategy:
|
|
219
|
+
fail-fast: false
|
|
220
|
+
max-parallel: 5
|
|
221
|
+
matrix: ${{ fromJson(needs.prepare.outputs.matrix) }}
|
|
222
|
+
|
|
223
|
+
steps:
|
|
224
|
+
- uses: actions/checkout@v4
|
|
225
|
+
|
|
226
|
+
- uses: ruby/setup-ruby@master
|
|
227
|
+
with:
|
|
228
|
+
bundler-cache: true
|
|
229
|
+
ruby-version: ${{ matrix.ruby.version }}
|
|
230
|
+
rubygems: ${{ matrix.ruby.rubygems }}
|
|
231
|
+
|
|
232
|
+
- uses: actions/download-artifact@v4
|
|
233
|
+
with:
|
|
234
|
+
pattern: pkg-*
|
|
235
|
+
path: pkg
|
|
236
|
+
merge-multiple: true
|
|
237
|
+
|
|
238
|
+
- name: Workaround for vcpkg
|
|
239
|
+
if: startsWith(matrix.os, 'ubuntu') || startsWith(matrix.os, 'macos')
|
|
240
|
+
shell: bash
|
|
241
|
+
run: |
|
|
242
|
+
if [[ "$RUNNER_OS" == "Linux" ]]; then
|
|
243
|
+
sudo apt-get update
|
|
244
|
+
sudo apt-get install -y gperf autoconf autoconf-archive automake libtool
|
|
245
|
+
elif [[ "$RUNNER_OS" == "macOS" ]]; then
|
|
246
|
+
brew install gperf autoconf autoconf-archive automake libtool
|
|
247
|
+
fi
|
|
248
|
+
|
|
249
|
+
- name: Install native gem
|
|
250
|
+
run: gem install -b pkg/emf2svg-$(ruby -I lib -r emf2svg/version -e "puts Emf2svg::VERSION").gem
|
|
251
|
+
|
|
252
|
+
- name: Test conversion
|
|
253
|
+
run: |
|
|
254
|
+
ruby -remf2svg -e "puts File.write('output.svg', Emf2svg.from_file('spec/examples/image1.emf'), mode: 'wb')"
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
name: release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*'
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
inputs:
|
|
9
|
+
bump-type:
|
|
10
|
+
description: 'What to bump before tagging'
|
|
11
|
+
type: choice
|
|
12
|
+
options:
|
|
13
|
+
- current
|
|
14
|
+
- iteration
|
|
15
|
+
- libemf2svg
|
|
16
|
+
default: iteration
|
|
17
|
+
libemf2svg-version:
|
|
18
|
+
description: 'New libemf2svg version (required when bump-type=libemf2svg, e.g. 1.8.3)'
|
|
19
|
+
type: string
|
|
20
|
+
required: false
|
|
21
|
+
|
|
22
|
+
# contents: write is needed for workflow_dispatch to push the bump commit + tag.
|
|
23
|
+
# id-token: write is required for RubyGems.org Trusted Publishing (OIDC).
|
|
24
|
+
permissions:
|
|
25
|
+
contents: write
|
|
26
|
+
id-token: write
|
|
27
|
+
|
|
28
|
+
jobs:
|
|
29
|
+
bump:
|
|
30
|
+
if: github.event_name == 'workflow_dispatch'
|
|
31
|
+
runs-on: ubuntu-latest
|
|
32
|
+
outputs:
|
|
33
|
+
sha: ${{ steps.sha.outputs.sha }}
|
|
34
|
+
new-version: ${{ steps.bump.outputs.new-version }}
|
|
35
|
+
steps:
|
|
36
|
+
- uses: actions/checkout@v4
|
|
37
|
+
|
|
38
|
+
- uses: ruby/setup-ruby@master
|
|
39
|
+
with:
|
|
40
|
+
ruby-version: '3.3'
|
|
41
|
+
|
|
42
|
+
- name: Bump version.rb
|
|
43
|
+
id: bump
|
|
44
|
+
shell: bash
|
|
45
|
+
env:
|
|
46
|
+
BUMP_TYPE: ${{ inputs.bump-type }}
|
|
47
|
+
LIBEMF2SVG_VERSION_INPUT: ${{ inputs.libemf2svg-version }}
|
|
48
|
+
run: |
|
|
49
|
+
set -euo pipefail
|
|
50
|
+
|
|
51
|
+
if [[ "$BUMP_TYPE" == "current" ]]; then
|
|
52
|
+
NEW_VERSION=$(ruby -Ilib -remf2svg/version -e 'puts Emf2svg::VERSION')
|
|
53
|
+
echo "new-version=${NEW_VERSION}" >> "$GITHUB_OUTPUT"
|
|
54
|
+
echo "sha=${{ github.sha }}" >> "$GITHUB_OUTPUT"
|
|
55
|
+
echo "Releasing current VERSION (${NEW_VERSION}) -- no bump."
|
|
56
|
+
exit 0
|
|
57
|
+
fi
|
|
58
|
+
|
|
59
|
+
ruby <<'RUBY'
|
|
60
|
+
bump_type = ENV.fetch("BUMP_TYPE")
|
|
61
|
+
path = "lib/emf2svg/version.rb"
|
|
62
|
+
content = File.read(path)
|
|
63
|
+
|
|
64
|
+
case bump_type
|
|
65
|
+
when "iteration"
|
|
66
|
+
m = %r{LIBEMF2SVG_RUBY_ITERATION = (\d+)}.match(content) or
|
|
67
|
+
raise "Could not find LIBEMF2SVG_RUBY_ITERATION in #{path}"
|
|
68
|
+
content.sub!(%r{LIBEMF2SVG_RUBY_ITERATION = \d+},
|
|
69
|
+
"LIBEMF2SVG_RUBY_ITERATION = #{m[1].to_i + 1}") or
|
|
70
|
+
raise "Failed to substitute iteration"
|
|
71
|
+
when "libemf2svg"
|
|
72
|
+
new_v = ENV.fetch("LIBEMF2SVG_VERSION_INPUT", "")
|
|
73
|
+
raise "libemf2svg-version input is required when bump-type=libemf2svg" if new_v.empty?
|
|
74
|
+
raise "Invalid version format: #{new_v} (expected X.Y.Z)" unless new_v.match?(/\A\d+\.\d+\.\d+\z/)
|
|
75
|
+
content.sub!(%r{LIBEMF2SVG_VERSION = "[^"]+"},
|
|
76
|
+
"LIBEMF2SVG_VERSION = \"#{new_v}\"") or
|
|
77
|
+
raise "Failed to substitute libemf2svg version"
|
|
78
|
+
content.sub!(%r{LIBEMF2SVG_RUBY_ITERATION = \d+},
|
|
79
|
+
"LIBEMF2SVG_RUBY_ITERATION = 0") or
|
|
80
|
+
raise "Failed to reset iteration"
|
|
81
|
+
else
|
|
82
|
+
raise "Unknown bump-type: #{bump_type}"
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
File.write(path, content)
|
|
86
|
+
load File.expand_path(path)
|
|
87
|
+
File.open(ENV.fetch("GITHUB_OUTPUT"), "a") do |f|
|
|
88
|
+
f.puts "new-version=#{Emf2svg::VERSION}"
|
|
89
|
+
end
|
|
90
|
+
warn "Bumped to #{Emf2svg::VERSION}"
|
|
91
|
+
RUBY
|
|
92
|
+
|
|
93
|
+
NEW_VERSION=$(ruby -Ilib -remf2svg/version -e 'puts Emf2svg::VERSION')
|
|
94
|
+
echo "new-version=${NEW_VERSION}" >> "$GITHUB_OUTPUT"
|
|
95
|
+
|
|
96
|
+
git config user.name "github-actions[bot]"
|
|
97
|
+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
98
|
+
git add lib/emf2svg/version.rb
|
|
99
|
+
git commit -m "Release v${NEW_VERSION}"
|
|
100
|
+
echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
|
|
101
|
+
|
|
102
|
+
- name: Show what's being released
|
|
103
|
+
run: |
|
|
104
|
+
echo "Releasing version: ${{ steps.bump.outputs.new-version }}"
|
|
105
|
+
git --no-pager log --oneline -1 "${{ steps.bump.outputs.sha }}"
|
|
106
|
+
|
|
107
|
+
- name: Push bump commit + tag
|
|
108
|
+
env:
|
|
109
|
+
NEW_VERSION: ${{ steps.bump.outputs.new-version }}
|
|
110
|
+
SHA: ${{ steps.bump.outputs.sha }}
|
|
111
|
+
run: |
|
|
112
|
+
# Only push the bump commit if it exists (skipped for bump-type=current).
|
|
113
|
+
if [[ -n "${SHA}" && "${SHA}" != "${{ github.sha }}" ]]; then
|
|
114
|
+
git push origin "HEAD:${{ github.event.repository.default_branch }}"
|
|
115
|
+
fi
|
|
116
|
+
git tag "v${NEW_VERSION}" "${SHA}"
|
|
117
|
+
git push origin "v${NEW_VERSION}"
|
|
118
|
+
|
|
119
|
+
build:
|
|
120
|
+
needs: bump
|
|
121
|
+
if: always() && !cancelled() && !failure() && (needs.bump.result == 'success' || needs.bump.result == 'skipped')
|
|
122
|
+
runs-on: ${{ matrix.os }}
|
|
123
|
+
strategy:
|
|
124
|
+
fail-fast: false
|
|
125
|
+
matrix:
|
|
126
|
+
include:
|
|
127
|
+
- os: ubuntu-latest
|
|
128
|
+
platform: any
|
|
129
|
+
ruby-version: '3.3'
|
|
130
|
+
- os: ubuntu-latest
|
|
131
|
+
platform: x86_64-linux
|
|
132
|
+
ruby-version: '3.3'
|
|
133
|
+
- os: ubuntu-24.04-arm
|
|
134
|
+
platform: aarch64-linux
|
|
135
|
+
ruby-version: '3.3'
|
|
136
|
+
- os: windows-latest
|
|
137
|
+
platform: x64-mingw32
|
|
138
|
+
ruby-version: '3.3'
|
|
139
|
+
- os: windows-latest
|
|
140
|
+
platform: x64-mingw-ucrt
|
|
141
|
+
ruby-version: '3.3'
|
|
142
|
+
- os: windows-11-arm
|
|
143
|
+
platform: aarch64-mingw-ucrt
|
|
144
|
+
ruby-version: '3.4'
|
|
145
|
+
- os: macos-latest
|
|
146
|
+
platform: arm64-darwin
|
|
147
|
+
ruby-version: '3.3'
|
|
148
|
+
- os: macos-15-intel
|
|
149
|
+
platform: x86_64-darwin
|
|
150
|
+
ruby-version: '3.3'
|
|
151
|
+
steps:
|
|
152
|
+
- uses: actions/checkout@v4
|
|
153
|
+
with:
|
|
154
|
+
ref: ${{ needs.bump.outputs.sha || github.ref }}
|
|
155
|
+
|
|
156
|
+
- uses: ruby/setup-ruby@master
|
|
157
|
+
with:
|
|
158
|
+
ruby-version: ${{ matrix.ruby-version }}
|
|
159
|
+
bundler-cache: true
|
|
160
|
+
|
|
161
|
+
- name: Workaround for vcpkg
|
|
162
|
+
if: startsWith(matrix.os, 'ubuntu') || startsWith(matrix.os, 'macos')
|
|
163
|
+
shell: bash
|
|
164
|
+
run: |
|
|
165
|
+
if [[ "$RUNNER_OS" == "Linux" ]]; then
|
|
166
|
+
sudo apt-get update
|
|
167
|
+
sudo apt-get install -y gperf autoconf autoconf-archive automake libtool
|
|
168
|
+
elif [[ "$RUNNER_OS" == "macOS" ]]; then
|
|
169
|
+
brew install gperf autoconf autoconf-archive automake libtool
|
|
170
|
+
fi
|
|
171
|
+
|
|
172
|
+
- run: bundle exec rake gem:native:${{ matrix.platform }}
|
|
173
|
+
|
|
174
|
+
- uses: actions/upload-artifact@v4
|
|
175
|
+
with:
|
|
176
|
+
name: pkg-${{ matrix.platform }}
|
|
177
|
+
path: pkg/*.gem
|
|
178
|
+
|
|
179
|
+
- name: Install gem
|
|
180
|
+
run: gem install -b pkg/emf2svg-*.gem
|
|
181
|
+
|
|
182
|
+
- name: Test conversion
|
|
183
|
+
run: |
|
|
184
|
+
ruby -remf2svg -e "puts File.write('output.svg', Emf2svg.from_file('spec/examples/image1.emf'), mode: 'wb')"
|
|
185
|
+
|
|
186
|
+
# Musl builds run inside an Alpine container so the resulting libs
|
|
187
|
+
# link against musl libc, not the runner's glibc.
|
|
188
|
+
#
|
|
189
|
+
# GitHub Actions does not allow JS-based actions inside an Alpine
|
|
190
|
+
# container on ARM64 runners. We do checkout + artifact on the host
|
|
191
|
+
# and run the build via `docker run` with the workspace mounted.
|
|
192
|
+
#
|
|
193
|
+
# NOTE: aarch64-linux-musl intentionally omitted -- vcpkg compiles
|
|
194
|
+
# all deps from source on arm64-musl and exceeds the 6h job limit.
|
|
195
|
+
# See build.yml for details.
|
|
196
|
+
build-musl:
|
|
197
|
+
needs: bump
|
|
198
|
+
if: always() && !cancelled() && !failure() && (needs.bump.result == 'success' || needs.bump.result == 'skipped')
|
|
199
|
+
runs-on: ${{ matrix.os }}
|
|
200
|
+
strategy:
|
|
201
|
+
fail-fast: false
|
|
202
|
+
matrix:
|
|
203
|
+
include:
|
|
204
|
+
- os: ubuntu-latest
|
|
205
|
+
platform: x86_64-linux-musl
|
|
206
|
+
steps:
|
|
207
|
+
- uses: actions/checkout@v4
|
|
208
|
+
with:
|
|
209
|
+
ref: ${{ needs.bump.outputs.sha || github.ref }}
|
|
210
|
+
|
|
211
|
+
- name: Build gem in Alpine container
|
|
212
|
+
env:
|
|
213
|
+
TARGET_PLATFORM: ${{ matrix.platform }}
|
|
214
|
+
run: |
|
|
215
|
+
docker run --rm \
|
|
216
|
+
-v "$PWD:/work" \
|
|
217
|
+
-w /work \
|
|
218
|
+
-e target_platform="${TARGET_PLATFORM}" \
|
|
219
|
+
alpine:3.20 sh -c '
|
|
220
|
+
set -eux
|
|
221
|
+
export VCPKG_FORCE_SYSTEM_BINARIES=1
|
|
222
|
+
apk add --no-cache \
|
|
223
|
+
build-base bash curl git cmake make ninja gcc g++ gperf \
|
|
224
|
+
automake autoconf autoconf-archive libtool linux-headers \
|
|
225
|
+
perl zip unzip tar python3 pkgconfig gcompat argp-standalone \
|
|
226
|
+
ruby ruby-dev ruby-bundler ruby-rake file
|
|
227
|
+
git config --global --add safe.directory /work
|
|
228
|
+
bundle config set --local path vendor/bundle
|
|
229
|
+
bundle install --jobs 4 --retry 3
|
|
230
|
+
bundle exec rake gem:native:"'"${TARGET_PLATFORM}"'"
|
|
231
|
+
'
|
|
232
|
+
|
|
233
|
+
- uses: actions/upload-artifact@v4
|
|
234
|
+
with:
|
|
235
|
+
name: pkg-${{ matrix.platform }}
|
|
236
|
+
path: pkg/*.gem
|
|
237
|
+
|
|
238
|
+
publish:
|
|
239
|
+
needs: [ bump, build, build-musl ]
|
|
240
|
+
if: always() && !cancelled() && !failure()
|
|
241
|
+
runs-on: ubuntu-latest
|
|
242
|
+
steps:
|
|
243
|
+
- uses: actions/checkout@v4
|
|
244
|
+
with:
|
|
245
|
+
ref: ${{ needs.bump.outputs.sha || github.ref }}
|
|
246
|
+
|
|
247
|
+
- uses: ruby/setup-ruby@master
|
|
248
|
+
with:
|
|
249
|
+
ruby-version: '3.3'
|
|
250
|
+
bundler-cache: true
|
|
251
|
+
|
|
252
|
+
- uses: actions/download-artifact@v4
|
|
253
|
+
with:
|
|
254
|
+
pattern: pkg-*
|
|
255
|
+
path: pkg
|
|
256
|
+
merge-multiple: true
|
|
257
|
+
|
|
258
|
+
- name: Configure RubyGems credentials (Trusted Publishing / OIDC)
|
|
259
|
+
uses: rubygems/configure-rubygems-credentials@main
|
|
260
|
+
|
|
261
|
+
- name: Publish to rubygems.org
|
|
262
|
+
run: |
|
|
263
|
+
for gem in pkg/*.gem; do gem push -V "$gem"; done
|
data/.gitignore
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/.bundle/
|
|
2
|
+
/.vscode
|
|
3
|
+
/.yardoc
|
|
4
|
+
/_yardoc/
|
|
5
|
+
/coverage/
|
|
6
|
+
/doc/
|
|
7
|
+
/pkg/
|
|
8
|
+
/spec/reports/
|
|
9
|
+
/tmp/
|
|
10
|
+
/ports/
|
|
11
|
+
/Gemfile.lock
|
|
12
|
+
*.installed
|
|
13
|
+
*.dll
|
|
14
|
+
*.dylib
|
|
15
|
+
*.so
|
|
16
|
+
|
|
17
|
+
# rspec failure tracking
|
|
18
|
+
.rspec_status
|
|
19
|
+
|
|
20
|
+
# remote file cache
|
|
21
|
+
.rubocop-*
|
data/.rspec
ADDED
data/.rubocop.yml
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
inherit_from:
|
|
2
|
+
- 'https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml'
|
|
3
|
+
|
|
4
|
+
AllCops:
|
|
5
|
+
TargetRubyVersion: 2.7
|
|
6
|
+
SuggestExtensions: false
|
|
7
|
+
Exclude:
|
|
8
|
+
- 'tmp/**/*'
|
|
9
|
+
- 'pkg/**/*'
|
|
10
|
+
- 'ports/**/*'
|
|
11
|
+
- 'vendor/**/*'
|
|
12
|
+
|
|
13
|
+
Gemspec/RequireMFA:
|
|
14
|
+
Enabled: false
|
data/CODE_OF_CONDUCT.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
|
6
|
+
|
|
7
|
+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
|
|
8
|
+
|
|
9
|
+
## Our Standards
|
|
10
|
+
|
|
11
|
+
Examples of behavior that contributes to a positive environment for our community include:
|
|
12
|
+
|
|
13
|
+
* Demonstrating empathy and kindness toward other people
|
|
14
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
|
15
|
+
* Giving and gracefully accepting constructive feedback
|
|
16
|
+
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
|
|
17
|
+
* Focusing on what is best not just for us as individuals, but for the overall community
|
|
18
|
+
|
|
19
|
+
Examples of unacceptable behavior include:
|
|
20
|
+
|
|
21
|
+
* The use of sexualized language or imagery, and sexual attention or
|
|
22
|
+
advances of any kind
|
|
23
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
|
24
|
+
* Public or private harassment
|
|
25
|
+
* Publishing others' private information, such as a physical or email
|
|
26
|
+
address, without their explicit permission
|
|
27
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
|
28
|
+
professional setting
|
|
29
|
+
|
|
30
|
+
## Enforcement Responsibilities
|
|
31
|
+
|
|
32
|
+
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
|
|
33
|
+
|
|
34
|
+
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
|
|
35
|
+
|
|
36
|
+
## Scope
|
|
37
|
+
|
|
38
|
+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
|
|
39
|
+
|
|
40
|
+
## Enforcement
|
|
41
|
+
|
|
42
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at ronald.tse@ribose.com. All complaints will be reviewed and investigated promptly and fairly.
|
|
43
|
+
|
|
44
|
+
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
|
|
45
|
+
|
|
46
|
+
## Enforcement Guidelines
|
|
47
|
+
|
|
48
|
+
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
|
|
49
|
+
|
|
50
|
+
### 1. Correction
|
|
51
|
+
|
|
52
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
|
|
53
|
+
|
|
54
|
+
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
|
|
55
|
+
|
|
56
|
+
### 2. Warning
|
|
57
|
+
|
|
58
|
+
**Community Impact**: A violation through a single incident or series of actions.
|
|
59
|
+
|
|
60
|
+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
|
|
61
|
+
|
|
62
|
+
### 3. Temporary Ban
|
|
63
|
+
|
|
64
|
+
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
|
|
65
|
+
|
|
66
|
+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
|
|
67
|
+
|
|
68
|
+
### 4. Permanent Ban
|
|
69
|
+
|
|
70
|
+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
|
|
71
|
+
|
|
72
|
+
**Consequence**: A permanent ban from any sort of public interaction within the community.
|
|
73
|
+
|
|
74
|
+
## Attribution
|
|
75
|
+
|
|
76
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
|
|
77
|
+
available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
|
78
|
+
|
|
79
|
+
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
|
|
80
|
+
|
|
81
|
+
[homepage]: https://www.contributor-covenant.org
|
|
82
|
+
|
|
83
|
+
For answers to common questions about this code of conduct, see the FAQ at
|
|
84
|
+
https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
|
data/Gemfile
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
source "https://rubygems.org"
|
|
4
|
+
|
|
5
|
+
# Specify your gem's dependencies in emf2svg.gemspec
|
|
6
|
+
gemspec
|
|
7
|
+
|
|
8
|
+
gem "rake", "~> 13.0"
|
|
9
|
+
|
|
10
|
+
gem "rspec", "~> 3.0"
|
|
11
|
+
|
|
12
|
+
gem "rubocop", "~> 1.7"
|
|
13
|
+
gem "rubocop-performance", "~> 1.0"
|
|
14
|
+
gem "rubocop-rails", "~> 2.0"
|