Skip to content

Commit

Permalink
fixup! Replace Travis CI with GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
lfdebrux committed Oct 21, 2021
1 parent 922744a commit cd2615d
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,22 @@ jobs:
with:
bundler-cache: true

- name: Check if new version to release
id: gem_version
run: |
gem_version=$(ruby -r rubygems -e "puts Gem::Specification::load('$(ls *.gemspec)').version")
echo "::set-output name=gem_version::$gem_version"
if git fetch origin "refs/tags/v$gem_version" >/dev/null 2>&1
then
echo "Tag 'v$gem_version' already exists"
echo "::set-output name=new_version::false"
else
echo "::set-output name=new_version::true"
fi
- name: Publish
if: ${{ steps.gem_version.outputs.new_version }}
env:
RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
GEM: govuk_tech_docs
Expand All @@ -35,7 +50,7 @@ jobs:
cat << EOF > ~/.gem/credentials
---
:rubygems_api_key: ${API_KEY}
:rubygems_api_key: ${RUBYGEMS_API_KEY}
EOF
chmod 0600 ~/.gem/credentials
Expand Down

0 comments on commit cd2615d

Please sign in to comment.