Skip to content

Commit

Permalink
(BUG) - fix gem release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanbreen28 committed Jul 29, 2024
1 parent e8db7f6 commit 19157ca
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 18 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]

0 comments on commit 19157ca

Please sign in to comment.