-
-
Notifications
You must be signed in to change notification settings - Fork 2
51 lines (40 loc) · 1.08 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: publish
on:
release:
types: [published]
permissions:
packages: write
contents: read
jobs:
tests:
uses: ./.github/workflows/tests.yml
secrets: inherit
publish:
runs-on: ubuntu-latest
needs: tests
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
rubygems: latest
bundler-cache: true
- name: Create credentials file
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 600 $HOME/.gem/credentials
echo ":github: Bearer ${GITHUB_TOKEN}" >> ~/.gem/credentials
echo ":rubygems_api_key: Bearer ${RUBYGEMS_AUTH_TOKEN}" > ~/.gem/credentials
- name: Build gem
run: gem build *.gemspec
- name: Publish to Github Packages
run: |
gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
OWNER: rafasoares
- name: Publish to RubyGems
run: |
gem push *.gem
env:
RUBYGEMS_AUTH_TOKEN: ${{secrets.RUBYGEMS_AUTH_TOKEN}}