Skip to content

Commit

Permalink
Update gem.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
takaebato committed Mar 16, 2024
1 parent dfdf0a3 commit 08bb222
Showing 1 changed file with 19 additions and 22 deletions.
41 changes: 19 additions & 22 deletions .github/workflows/gem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ name: Cross Gem

on:
push:
branches:
- release-gem-workflow
# tags:
# - "v*"
tags:
- "v*"

jobs:
ci-data:
Expand Down Expand Up @@ -48,23 +46,22 @@ jobs:
if-no-files-found: error
retention-days: 1

- name: Display structure of created files
run: git ls-files
- name: Display structure of created files
run: ls -R pkg/
# - name: Release gem
# if: startsWith(github.ref, 'refs/tags/v')
# working-directory: pkg/
# env:
# GEM_API_KEY: ${{secrets.GEM_API_KEY}}
# run: |
# mkdir -p $HOME/.gem
# touch $HOME/.gem/credentials
# chmod 0600 $HOME/.gem/credentials
# printf -- "---\n:rubygems_api_key: ${GEM_API_KEY}\n" > $HOME/.gem/credentials
# for i in *.gem; do
# if [ -f "$i" ]
# then
# gem push "$i" || true
# fi
# done

- name: Release gem
if: startsWith(github.ref, 'refs/tags/v')
working-directory: pkg/
env:
GEM_API_KEY: ${{secrets.GEM_API_KEY}}
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:rubygems_api_key: ${GEM_API_KEY}\n" > $HOME/.gem/credentials
for i in *.gem; do
if [ -f "$i" ]
then
gem push "$i" || true
fi
done

0 comments on commit 08bb222

Please sign in to comment.