-
Notifications
You must be signed in to change notification settings - Fork 111
41 lines (36 loc) · 1.06 KB
/
release.yaml
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
name: Release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
jobs:
release:
name: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
bundler-cache: true
- name: Log into Rubygems
run: |
mkdir -p ~/.local/share/gem
echo ":rubygems_api_key: ${{ secrets.RUBYGEMS_API_KEY }}" > ~/.local/share/gem/credentials
chmod 600 ~/.local/share/gem/credentials
- name: Release
run: |
set -e
PKG="$(echo *.gemspec | sed 's/.gemspec//')"
VERSION="${GITHUB_REF#refs/tags/v}"
bundle exec rake build
GEM="pkg/$PKG-$VERSION.gem"
if [ -f "$GEM" ]; then
gem push $GEM
echo "Release $VERSION done."
else
echo "Build did not create a $VERSION release gem."
echo "Please check the version in the gemspec and try again."
cat *.gemspec | grep '\.version'
exit 1
fi