Skip to content

Commit

Permalink
Merge pull request #388 from puppetlabs/bug-fix_release_workflow
Browse files Browse the repository at this point in the history
(bug) - Fix release workflows and add stricter gem dependencies
  • Loading branch information
LukasAud authored Jul 30, 2024
2 parents e8db7f6 + ac27b66 commit c6a4d5f
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 24 deletions.
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

0 comments on commit c6a4d5f

Please sign in to comment.