Skip to content

Commit 5bb049c

Browse files
committed
Update release workflow to on dispatch
1 parent 0883bbc commit 5bb049c

File tree

3 files changed

+43
-32
lines changed

3 files changed

+43
-32
lines changed

.github/workflows/gempush.yml

-29
This file was deleted.

.github/workflows/release.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Release
2+
3+
on: workflow_dispatch
4+
5+
jobs:
6+
release:
7+
name: Build + Publish
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Get Version
13+
id: gv
14+
run: |
15+
echo "::set-output name=ver::$(grep VERSION lib/vmfloaty/version.rb |rev |cut -d "'" -f2 |rev)"
16+
17+
- name: Tag Release
18+
uses: ncipollo/release-action@v1
19+
with:
20+
tag: ${{ steps.gv.outputs.ver }}
21+
token: ${{ secrets.GITHUB_TOKEN }}
22+
draft: false
23+
prerelease: false
24+
generateReleaseNotes: true
25+
26+
- name: Set up Ruby 2.7
27+
uses: actions/setup-ruby@v1
28+
with:
29+
version: 2.7.x
30+
31+
- name: Build gem
32+
run: gem build *.gemspec
33+
34+
- name: Publish gem
35+
run: |
36+
mkdir -p $HOME/.gem
37+
touch $HOME/.gem/credentials
38+
chmod 0600 $HOME/.gem/credentials
39+
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
40+
gem push *.gem
41+
env:
42+
GEM_HOST_API_KEY: ${{secrets.RUBYGEMS_AUTH_TOKEN}}

README.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,7 @@ Please wait for multiple code owners to sign off on any notable change.
180180
Releasing is a two step process:
181181

182182
1. submit a release prep PR that updates `lib/vmfloaty/version.rb` to the desired new version and get that merged
183-
2. push a tag in the format of `vX.Y.Z` where `X.Y.Z` is a semantic version number. Pushing the tag will trigger the [Gem Push](.github/workflows/gempush.yml) action which builds the gem and pushes it to RubyGems.
184-
185-
Once the tag has been pushed, please also generate a release on GitHub.
183+
2. Navigate to <https://github.com/puppetlabs/vmfloaty/actions/workflows/release.yml> --> Run workflow --> select "main" branch --> Run workflow. This will publish a GitHub release, build, and push the gem to RubyGems.
186184

187185
## Special thanks
188186

0 commit comments

Comments
 (0)