-
Notifications
You must be signed in to change notification settings - Fork 41
60 lines (49 loc) · 1.68 KB
/
Copy pathrelease.yml
File metadata and controls
60 lines (49 loc) · 1.68 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
name: Release gem on RubyGems.org and create GitHub release
on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+
- v[0-9]+.[0-9]+.[0-9]+.beta[0-9]*
jobs:
release_gem:
name: Release gem on RubyGems.org
if: github.repository == 'Shopify/ruby-lsp-rails'
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
environment: release
steps:
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Set up Ruby
uses: ruby/setup-ruby@d45b1a4e94b71acab930e56e79c6aa188764e7f9 # v1.316.0
with:
bundler-cache: true
- name: Release gem on RubyGems.org
uses: rubygems/release-gem@052cc82692552de3ef2b81fd670e41d13cba8092 # v1.4.0
release_github:
name: Create GitHub release
if: github.repository == 'Shopify/ruby-lsp-rails'
needs: release_gem
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Create release
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
script: |
await github.rest.repos.createRelease({
owner: context.repo.owner,
repo: context.repo.repo,
tag_name: "${{ github.ref }}",
name: "${{ github.ref_name }}",
generate_release_notes: true,
prerelease: "${{ github.ref_name }}".includes(".beta")
});