File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,35 +46,29 @@ jobs:
4646 name : parsekit-${{ matrix.platform }}
4747 path : pkg/*${{ matrix.platform }}.gem
4848 if-no-files-found : error
49- publish :
50- name : Publish gems to GitHub Packages
51- needs : build
52- runs-on : ubuntu-latest
53- permissions :
54- contents : read
55- packages : write
56- steps :
57- - name : Download all gem artifacts
58- uses : actions/download-artifact@v4
59- with :
60- pattern : parsekit-*
61- merge-multiple : true
62- path : pkg
6349
64- - name : Configure RubyGems credentials for GitHub Packages
65- env :
66- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
67- run : |
68- mkdir -p ~/.gem
69- printf -- "---\n:github: Bearer %s\n" "$GITHUB_TOKEN" > ~/.gem/credentials
70- chmod 0600 ~/.gem/credentials
50+ publish :
51+ name : Publish gems to RubyGems
52+ needs : build
53+ runs-on : ubuntu-latest
54+ if : startsWith(github.ref, 'refs/tags/')
55+ permissions :
56+ contents : read
57+ steps :
58+ - name : Download all gem artifacts
59+ uses : actions/download-artifact@v4
60+ with :
61+ pattern : parsekit-*
62+ merge-multiple : true
63+ path : pkg
7164
72- - name : Push gems to GitHub Packages
73- env :
74- OWNER : ${{ github.repository_owner }}
75- run : |
76- shopt -s nullglob
77- for g in pkg/*.gem; do
78- echo "Pushing $g"
79- gem push --key github --host "https://rubygems.pkg.github.com/Teamtailor" "$g"
80- done
65+ - name : Publish to RubyGems
66+ env :
67+ GEM_HOST_API_KEY : ${{ secrets.RUBYGEMS_API_KEY }}
68+ run : |
69+ set -euo pipefail
70+ shopt -s nullglob
71+ for gem_file in pkg/*.gem; do
72+ echo "Pushing ${gem_file}"
73+ gem push "$gem_file"
74+ done
You can’t perform that action at this time.
0 commit comments