Skip to content

Commit 5bfdaf1

Browse files
authored
add automation for publishing this gem (#13)
1 parent 74fece8 commit 5bfdaf1

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

.github/workflows/publish.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Publish Gem
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Set version
14+
id: version
15+
run: echo "version=${GITHUB_REF#refs/*/v}" >> $GITHUB_OUTPUT
16+
17+
- name: checkout
18+
uses: actions/checkout@v3
19+
20+
- name: Setup Ruby using Bundler
21+
uses: ruby/setup-ruby@v1
22+
with:
23+
ruby-version: "2.7.1"
24+
bundler-cache: true
25+
bundler: "2.1.4"
26+
27+
- name: install gems
28+
run: bundle install
29+
30+
- name: Setup Rubygems credentials
31+
run: |
32+
set +x
33+
mkdir -p ~/.gem
34+
cat << EOF > ~/.gem/credentials
35+
---
36+
:rubygems_api_key: ${{ secrets.OSC_ROBOT_RUBYGEMS_TOKEN }}
37+
EOF
38+
chmod 0600 ~/.gem/credentials
39+
40+
- name: Publish Gem
41+
run: |
42+
bundle exec rake build
43+
gem push pkg/ood_support-${{ steps.version.outputs.version }}.gem

0 commit comments

Comments
 (0)