-
Notifications
You must be signed in to change notification settings - Fork 38
46 lines (45 loc) · 1.38 KB
/
release.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
name: Publish Gem
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: master
- name: update version
run: sed -i -r "s/VERSION = \"[0-9a-z.-]+\"\$/VERSION = \"${GITHUB_REF#refs/*/}\"/g" lib/adzerk/version.rb
- name: push updated version
run: |
git config --global user.name 'Kevel CI'
git config --global user.email 'engineering@kevel.co'
if git commit -am "Bump version to ${GITHUB_REF#refs/*/}"; then
git tag --force ${GITHUB_REF#refs/*/}
git push
git push --tags --force
fi
env:
GITHUB_TOKEN: ${{secrets.REPO_READ_TOKEN}}
- name: set up ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.6'
- name: create credentials folder
run: mkdir -p ~/.gem
- name: create credentials file
run: |
cat << EOF >> ~/.gem/credentials
---
:rubygems_api_key: ${{secrets.RUBYGEMS_API_KEY}}
EOF
chmod 0600 ~/.gem/credentials
- name: update bundler
run: gem update bundler
- name: install dependencies
run: bundle install
- name: build gem
run: bundle exec rake build
- name: publish gem
run: gem push ./pkg/adzerk-${GITHUB_REF#refs/*/}.gem