-
Notifications
You must be signed in to change notification settings - Fork 4
42 lines (36 loc) · 1.01 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
name: Publish Gem
on:
push:
branches:
- main
- master
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- name: Setup Ruby and install gems
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: 3.2.2
rubygems: latest
- name: Release Gem
run: |
VERSION=$(bundle exec rake version)
GEM_VERSION=$(gem list --exact --remote $GEM_NAME)
# Publish to RubyGems.org
if [ "${GEM_VERSION}" != "$GEM_NAME (${VERSION})" ]; then
gem build $GEM_NAME.gemspec
gem push "$GEM_NAME-${VERSION}.gem"
fi
# Create a release tag
if ! git ls-remote --tags --exit-code origin v${VERSION}; then
git tag v${VERSION}
git push --tags
fi
env:
GEM_HOST_API_KEY: "${{ secrets.RUBYGEMS_AUTH_TOKEN }}"
GEM_NAME: archivesspace-client