diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..74e0f45 --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,30 @@ +name: Publish + +on : + release: + types: [published] + +jobs: + push: + runs-on: ubuntu-latest + + permissions: + contents: write + id-token: write + + # If you configured a GitHub environment on RubyGems, you must use it here. + environment: release + + steps: + # Set up + - uses: actions/checkout@v5 + with: + persist-credentials: false + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + ruby-version: ruby + + # Release + - uses: rubygems/release-gem@v1 diff --git a/.github/workflows/ruby.yml b/.github/workflows/runtests.yml similarity index 98% rename from .github/workflows/ruby.yml rename to .github/workflows/runtests.yml index 98b525d..c1b8d51 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/runtests.yml @@ -5,7 +5,7 @@ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby -name: Ruby +name: Run tests on: push: diff --git a/alns.gemspec b/alns.gemspec index fe19de7..5775122 100644 --- a/alns.gemspec +++ b/alns.gemspec @@ -1,15 +1,15 @@ # frozen_string_literal: true -Gem::Specification.new do |s| +require './lib/alns/version' + +ALNS::GEMSPEC = Gem::Specification.new do |s| s.name = 'alns' - s.version = '0.1.0' + s.version = ALNS::VERSION s.summary = 'Adaptive Large Neighbourhood Search' - s.description = '' s.authors = ['bibenga'] s.email = 'bibenga@users.noreply.github.com' s.files = Dir['LICENSE', 'lib/**/*.rb'] s.require_paths = ['lib'] - # s.homepage = 'https://rubygems.org/gems/example' s.homepage = 'https://github.com/bibenga/alns-ruby' s.metadata = { 'source_code_uri' => 'https://github.com/bibenga/alns-ruby' } s.license = 'MIT' diff --git a/lib/alns/version.rb b/lib/alns/version.rb new file mode 100644 index 0000000..03a6f7a --- /dev/null +++ b/lib/alns/version.rb @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +module ALNS + VERSION = '0.1.1' +end