This repository has been archived by the owner on Jan 23, 2024. It is now read-only.
forked from iugu/iugu-ruby
-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (48 loc) · 1.81 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
47
48
name: Release
on:
workflow_dispatch:
push:
branches:
- master
jobs:
RubyGems:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1.2'
- name: Set environment variables
id: vars
run: |
echo ::set-output name=project_name::$(cat .ruby-gemset)
echo ::set-output name=project_version::$(ruby bin/version)
- name: Install dependencies
run: bundle install --full-index --jobs 4 --retry 3
- name: Configure the credentials
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:rubygems_api_key: ${RUBYGEMS_API_KEY}\n:github: Bearer ${GITHUB_KEY}\n" > $HOME/.gem/credentials
env:
GITHUB_KEY: "${{ secrets.GITHUB_TOKEN }}"
RUBYGEMS_API_KEY: "${{ secrets.RUBYGEMS_API_KEY }}"
- name: Build the Gem
run: gem build ${{ steps.vars.outputs.project_name }}.gemspec
- name: Push to the RubyGems
continue-on-error: true
run: gem push ${{ steps.vars.outputs.project_name }}-${{ steps.vars.outputs.project_version }}.gem
- name: Push to the GitHub repository
continue-on-error: true
run: gem push --key github --host https://rubygems.pkg.github.com/dcotecnologia ${{ steps.vars.outputs.project_name }}-${{ steps.vars.outputs.project_version }}.gem
- name: Create a GitHub release
uses: ncipollo/release-action@v1
with:
tag: v${{ steps.vars.outputs.project_version }}
name: v${{ steps.vars.outputs.project_version }}
bodyFile: "CHANGELOG.md"
allowUpdates: true
token: ${{ secrets.GITHUB_TOKEN }}