Skip to content

Commit

Permalink
Inline deploy script for easier copying to related projects
Browse files Browse the repository at this point in the history
  • Loading branch information
nicksieger committed Nov 30, 2023
1 parent ff9ed32 commit 7766001
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 34 deletions.
24 changes: 20 additions & 4 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:

env:
RUBY_VERSION: "3.2"
GEM_NAME: octopolo

jobs:
test:
Expand Down Expand Up @@ -40,8 +41,23 @@ jobs:
with:
ruby-version: ${{ env.RUBY_VERSION }}

- name: Publish package to GPR and Gemfury
- name: Publish package to GPR
run: |
./deploy.sh
env:
GEM_HOST_API_KEY: "Bearer ${{secrets.GITHUB_TOKEN}}"
set -eo pipefail
# Publish gem only when lib/$GEM_NAME/version.rb changed
if git show -m --pretty=format:%H --name-only $GITHUB_SHA | \
grep -q "lib/$GEM_NAME/version.rb"; then
rm -rf *.gem
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:github: ${GITHUB_TOKEN}\n" > $HOME/.gem/credentials
gem build $GEM_NAME.gemspec
package=$(echo *.gem)
echo "Publishing $package to github..."
gem push --KEY github --host https://rubygems.pkg.github.com/sportngin $package
fi
30 changes: 0 additions & 30 deletions deploy.sh

This file was deleted.

0 comments on commit 7766001

Please sign in to comment.