Skip to content

Commit b6fc86a

Browse files
committed
Borrow the release workflow from the main branch
While here, adjust the GitHub registry URL to test the chages in #86.
1 parent c11f5cb commit b6fc86a

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/release.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
name: Gem Release
3+
4+
on:
5+
push:
6+
tags:
7+
- '7.*'
8+
9+
jobs:
10+
release:
11+
name: Release gem
12+
runs-on: ubuntu-24.04
13+
# Optional but recommended to use a specific environment
14+
environment: release
15+
# Prevent releases from forked repositories
16+
if: github.repository_owner == 'OpenVoxProject'
17+
18+
permissions:
19+
id-token: write
20+
contents: write
21+
packages: write
22+
23+
steps:
24+
- uses: voxpupuli/ruby-release@v0
25+
- name: Setup GitHub packages access
26+
run: |
27+
mkdir -p ~/.gem
28+
echo ":github: Bearer ${{ secrets.GITHUB_TOKEN }}" >> ~/.gem/credentials
29+
chmod 0600 ~/.gem/credentials
30+
- name: Publish gem to GitHub packages
31+
run: gem push --key github --host https://rubygems.pkg.github.com/OpenVoxProject *.gem
32+
- name: Create Release Page
33+
shell: bash
34+
env:
35+
GH_TOKEN: ${{ github.token }}
36+
run: gh release create ${{ github.ref_name }} --generate-notes
37+
- name: Attach gem to GitHub Release
38+
shell: bash
39+
env:
40+
GH_TOKEN: ${{ github.token }}
41+
run: gh release upload ${{ github.ref_name }} pkg/*.gem

0 commit comments

Comments
 (0)