-
Notifications
You must be signed in to change notification settings - Fork 2
65 lines (60 loc) · 1.72 KB
/
gem_release.yaml
File metadata and controls
65 lines (60 loc) · 1.72 KB
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
---
name: Gem Release
on:
push:
tags:
- '*'
permissions: {}
jobs:
build-release:
# Prevent releases from forked repositories
if: github.repository_owner == 'OpenVoxProject'
name: Build the gem
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 'ruby'
- name: Build gem
shell: bash
run: gem build --verbose *.gemspec
- name: Upload gem to GitHub cache
uses: actions/upload-artifact@v6
with:
name: gem-artifact
path: '*.gem'
retention-days: 1
compression-level: 0
create-github-release:
needs: build-release
name: Create GitHub release
runs-on: ubuntu-24.04
permissions:
contents: write # clone repo and create release
steps:
- name: Download gem from GitHub cache
uses: actions/download-artifact@v7
with:
name: gem-artifact
- name: Create Release
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: gh release create --repo ${{ github.repository }} ${{ github.ref_name }} --generate-notes *.gem
release-to-github:
needs: build-release
name: Release to GitHub
runs-on: ubuntu-24.04
permissions:
packages: write # publish to rubygems.pkg.github.com
steps:
- name: Download gem from GitHub cache
uses: actions/download-artifact@v7
with:
name: gem-artifact
- name: Publish gem to GitHub packages
run: gem push --host https://rubygems.pkg.github.com/${{ github.repository_owner }} *.gem
env:
GEM_HOST_API_KEY: ${{ secrets.GITHUB_TOKEN }}