diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..3508073 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,28 @@ +name: Release gems +on: + workflow_dispatch: + push: + tags: + - v* + +jobs: + release: + runs-on: ubuntu-latest + permissions: + contents: write + id-token: write + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # Fetch current tag as annotated. See https://github.com/actions/checkout/issues/290 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: 3.2 + bundler-cache: true + - name: Configure RubyGems Credentials + uses: rubygems/configure-rubygems-credentials@main + - name: Publish to RubyGems + run: | + gem install gem-release + make ci-release diff --git a/Makefile b/Makefile index 0d7b76d..eb4bb7d 100644 --- a/Makefile +++ b/Makefile @@ -15,3 +15,6 @@ release: test lint RELEASING_GEM=true gem release -t git push git push --tags + +ci-release: test lint + RELEASING_GEM=true gem release diff --git a/view_component-contrib.gemspec b/view_component-contrib.gemspec index cccd93c..9fa81b2 100644 --- a/view_component-contrib.gemspec +++ b/view_component-contrib.gemspec @@ -21,7 +21,7 @@ Gem::Specification.new do |s| s.license = "MIT" - s.files = Dir.glob("app/**/*") + Dir.glob("lib/**/*") + %w[README.md LICENSE.txt CHANGELOG.md] + s.files = Dir.glob("app/**/*") + Dir.glob("lib/.rbnext/**/*") + Dir.glob("lib/**/*") + %w[README.md LICENSE.txt CHANGELOG.md] s.require_paths = ["lib"] s.required_ruby_version = ">= 2.7"