Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(bug) - Fix release workflows and add stricter gem dependencies #388

Merged
merged 2 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions .github/workflows/gem_release.yml

This file was deleted.

22 changes: 21 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,26 @@ jobs:

- name: "Create release"
run: |
gh release create v${{ steps.get_version.outputs.version }} ./output/* --title v${{ steps.get_version.outputs.version }} -F OUTPUT.md
gh release create v${{ steps.get_version.outputs.version }} ./pkg/* --title v${{ steps.get_version.outputs.version }} -F OUTPUT.md
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: "Publish gem to rubygems"
run: |
gem push ./pkg/*.gem
env:
GEM_HOST_API_KEY: '${{ secrets.GEM_HOST_API_KEY }}'

- name: "Publish to GitHub Package"
run: |
echo "Setting up access to RubyGems"
mkdir -p ~/.gem
touch ~/.gem/credentials
chmod 600 ~/.gem/credentials

echo "Logging in to GitHub Package Registry"
echo "---" > ~/.gem/credentials
echo ":github: Bearer ${{ secrets.GITHUB_TOKEN }}" >> ~/.gem/credentials

echo "Pushing gem to GitHub Package Registry"
gem push --key "github" --host "https://rubygems.pkg.github.com/${{github.repository_owner}}" ./pkg/*.gem
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ log/
tmp/
output/
vendor/
pkg/
7 changes: 6 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ task build: [:gem_revendor] do
require 'digest'

project_dir = File.dirname(__FILE__)
output_dir = File.join(project_dir, 'output')
output_dir = File.join(project_dir, './pkg/')

file_list = ['lib', 'vendor', 'puppet-languageserver', 'puppet-debugserver', 'puppet-languageserver-sidecar', 'LICENSE']
# Remove files in the list that do not exist.
Expand Down Expand Up @@ -180,6 +180,11 @@ task build: [:gem_revendor] do
File.open(filepath + '.sha256', 'wb') { |file| file.write(sha) }
end
puts "Created checksums"

puts 'Building gem..'
require 'bundler/gem_tasks'
Rake::Task['build'].invoke
puts 'Gem built'
end

task :default => [:test]
12 changes: 6 additions & 6 deletions puppet-editor-services.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ Gem::Specification.new do |s|
'bin/*',
'[A-Z]*'].to_a
s.license = 'Apache-2.0'
s.add_runtime_dependency 'puppet-lint'
s.add_runtime_dependency 'hiera-eyaml'
s.add_runtime_dependency 'puppetfile-resolver'
s.add_runtime_dependency 'molinillo'
s.add_runtime_dependency 'puppet-strings'
s.add_runtime_dependency 'yard'
s.add_runtime_dependency 'puppet-lint', '~> 4.0'
s.add_runtime_dependency 'hiera-eyaml', '~> 2.1'
s.add_runtime_dependency 'puppetfile-resolver', '~> 0.6'
s.add_runtime_dependency 'molinillo', '~> 0.6'
s.add_runtime_dependency 'puppet-strings', '~> 4.0'
s.add_runtime_dependency 'yard', '~> 0.9'
end
Loading