Skip to content

Commit c737f8a

Browse files
committed
gemspec: connect to GitHub Packages
1 parent 95a71cb commit c737f8a

2 files changed

Lines changed: 40 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: publish
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
setup:
9+
name: Set Up Environment
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: ruby/setup-ruby@v1
14+
with:
15+
bundler-cache: true
16+
- run: bundle install
17+
18+
publish-ghp:
19+
needs: [setup]
20+
name: Publish Gem
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Publish
24+
shell: bash
25+
run: |
26+
set +x
27+
mkdir -p ~/.gem
28+
cat << EOF > ~/.gem/credentials
29+
---
30+
:github: Bearer ${{ GITHUB_TOKEN }}
31+
:rubygems_api_key: ${{ secrets.RUBYGEMS_API_KEY }}
32+
EOF
33+
34+
chmod 0600 ~/.gem/credentials
35+
set -x
36+
37+
bundle exec gem build *.gemspec
38+
bundle exec gem push --key github --host "https://rubygems.pkg.github.com/chtzvt"
39+
bundle exec gem push --key rubygems_api_key --host "https://rubygems.org"

sssecrets.gemspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Gem::Specification.new do |spec|
1313

1414
spec.metadata["homepage_uri"] = spec.homepage
1515
spec.metadata["source_code_uri"] = "https://github.com/chtzvt/sssecrets"
16+
spec.metadata["github_repo"] = "ssh://github.com/chtzvt/sssecrets"
1617

1718
# Specify which files should be added to the gem when it is released.
1819
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.

0 commit comments

Comments
 (0)