Skip to content

Commit

Permalink
Merge pull request #24 from nobu/package
Browse files Browse the repository at this point in the history
Package
  • Loading branch information
nobu authored Mar 23, 2024
2 parents 7c825c1 + 8782313 commit b979e88
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ jobs:
ruby: ${{ fromJson(needs.ruby-versions.outputs.versions) }}
runs-on: windows-latest
steps:
- name: git config
run: |
git config --global core.autocrlf false
git config --global core.eol lf
git config --global advice.detachedHead 0
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
Expand All @@ -28,3 +33,19 @@ jobs:
- name: Run test
run: bundle exec rake

- id: build
run: |
bundle exec rake build
echo "pkg=${GITHUB_REPOSITORY#*/}" >> $GITHUB_OUTPUT
if: >-
${{
github.event_name == 'push' &&
(matrix.ruby == needs.ruby-versions.outputs.latest)
}}
shell: bash
- name: Upload package
uses: actions/upload-artifact@v4
with:
path: pkg/*.gem
name: ${{steps.build.outputs.pkg}}
if: steps.build.outputs.pkg
8 changes: 5 additions & 3 deletions win32ole.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ Gem::Specification.new do |spec|
spec.metadata["homepage_uri"] = spec.homepage
spec.metadata["source_code_uri"] = spec.homepage

spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
end
cmd = %W[git ls-files -z --
:^#{File.basename(__FILE__)}
:^/bin/ :^/test/ :^/rakelib/ :^/.git* :^Gemfile* :^Rakefile*
]
spec.files = IO.popen(cmd, chdir: __dir__, err: IO::NULL, exception: false, &:read).split("\x0")
spec.bindir = "exe"
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]
Expand Down

0 comments on commit b979e88

Please sign in to comment.