forked from NikoRoberts/tzf-rb
-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (28 loc) · 937 Bytes
/
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
name: Publish
on:
push:
tags:
- '*'
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write # Required for `rake release` to push the release tag
id-token: write # Required for trusted publishing
packages: write # Required for publishing to GitHub Package Registry
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
- name: Publish to GitHub Packages
env:
GEM_HOST_API_KEY: "Bearer ${{ secrets.GITHUB_TOKEN }}"
OWNER: ${{ github.repository_owner }}
run: |
mkdir -pv $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:github: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
gem build *.gemspec
gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem