-
Notifications
You must be signed in to change notification settings - Fork 0
106 lines (91 loc) · 2.83 KB
/
master.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
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: Release Gem Package
on:
push:
branches:
- master
- master-worlflow-update
jobs:
release_gem_linux:
name: Release Gem for Linux
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set Up Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: 3.0
- name: Install Dependencies
run: |
gem install bundler
bundle install
- name: Build Gem Package
run: |
gem build middleware_rubygem.gemspec
- name: Publish Gem Package
env:
GEM_HOST_API_KEY: ${{ secrets.RUBY_GEMS_API_KEY }}
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
gem build *.gemspec
# gem push *.gem
release_gem_windows:
name: Release Gem for Windows
runs-on: windows-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set Up Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: 3.0
- name: Install Dependencies
run: |
gem install bundler
gem install 'bigdecimal'
bundle install
- name: Build Gem Package
run: |
gem build middleware_rubygem.gemspec
- name: Publish Gem Package
shell: bash
env:
GEM_HOST_API_KEY: ${{ secrets.RUBY_GEMS_API_KEY }}
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
gem build *.gemspec
# gem push *.gem
create_release:
name: Release the latest release
runs-on: ubuntu-latest
needs:
- release_gem_linux
- release_gem_windows
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Get the new Version
id: get_new_version
shell: bash
run: |
# Extract the new version from the commit
NEW_VERSION=$(git show HEAD:lib/middleware/ruby_gem/version.rb | grep 'VERSION =' | awk '{print $3}' | tr -d '"')
echo "::set-output name=version::$NEW_VERSION"
# - name: Create Release
# id: create_release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: v${{ steps.get_new_version.outputs.version }}
# release_name: Release ${{ steps.get_new_version.outputs.version }}
# body: |
# Release ${{ steps.get_new_version.outputs.version }}
# draft: false
# prerelease: false