-
Notifications
You must be signed in to change notification settings - Fork 153
69 lines (53 loc) · 1.53 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Publish RubyGem
on:
workflow_call:
secrets:
JS_ROUTES_RUBYGEMS_KEY:
description: "RubyGems account API key"
required: true
workflow_dispatch: # Trigger the workflow manually
inputs:
otp_code:
description: 'Enter the RubyGems OTP code'
required: true
type: string
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3.4'
- name: Extract Gem Version
id: extract_version
run: |
VERSION=$(./.github/workflows/scripts/version.sh)
echo "Version: $VERSION"
echo "gem_version=$VERSION" >> $GITHUB_ENV
- name: Install dependencies
run: bundle install
- name: Extract Changelog
run: ./.github/workflows/scripts/changelog.sh
- name: Build the gem
run: gem build *.gemspec
- name: Tag the release version
run: ./.github/workflows/scripts/tag.sh
- name: Publish to RubyGems
env:
GEM_HOST_API_KEY: ${{ secrets.JS_ROUTES_RUBYGEMS_KEY }}
run: |
echo "${GEM_HOST_API_KEY:0:16}"
gem push *.gem --otp ${{ github.event.inputs.otp_code }}
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
name: "v${{ env.gem_version }}"
tag_name: "v${{ env.gem_version }}"
body_path: ./release_changelog.md
draft: false
prerelease: false