Repository navigation
76 lines (76 loc) · 2.19 KB
/
Copy pathrelease.yml
File metadata and controls
76 lines (76 loc) · 2.19 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
66
67
68
69
70
71
72
73
74
75
76
name: Release
on:
workflow_dispatch:
inputs:
bump:
description: Version bump
type: choice
default: patch
options: [patch, minor, major]
release_tag:
description: Existing version tag to publish without a bump
type: string
required: false
concurrency:
group: release
cancel-in-progress: false
permissions:
contents: read
jobs:
version:
runs-on: ubuntu-24.04
permissions:
contents: write
outputs:
sha: ${{ steps.version.outputs.sha }}
tag: ${{ steps.version.outputs.tag }}
steps:
- uses: actions/checkout@v7
with:
ref: ${{ inputs.release_tag || github.ref }}
fetch-depth: 0
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
- id: version
env:
BUMP: ${{ inputs.bump }}
RELEASE_TAG: ${{ inputs.release_tag }}
run: ruby script/prepare-release
packages:
needs: version
uses: ./.github/workflows/native-gems.yml
with:
ref: ${{ needs.version.outputs.sha }}
publish:
needs: [version, packages]
runs-on: ubuntu-24.04
environment: release
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v7
with:
ref: ${{ needs.version.outputs.sha }}
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
- uses: actions/download-artifact@v7
with:
pattern: gem-*
merge-multiple: true
path: pkg
- run: ruby script/verify-packages
- uses: rubygems/configure-rubygems-credentials@dc5a8d8553e6ee01fc26761a49e99e733d17954a # v2.1.0
- name: Publish tested native gems, then source fallback
run: |
for package in pkg/*-darwin.gem pkg/*-linux-gnu.gem; do
gem push "$package"
done
gem push "$(ruby -e 'print "pkg/quack-ruby-#{Gem::Specification.load("quack-ruby.gemspec").version}.gem"')"
- name: Create GitHub Release
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ needs.version.outputs.tag }}
run: gh release create "$RELEASE_TAG" pkg/*.gem --verify-tag --generate-notes