-
Notifications
You must be signed in to change notification settings - Fork 17
63 lines (52 loc) · 1.95 KB
/
Copy pathrelease.yml
File metadata and controls
63 lines (52 loc) · 1.95 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
---
name: Release
on:
workflow_dispatch:
inputs:
version:
description: "Release version (e.g., 1.12.0)"
required: true
type: string
jobs:
release:
name: Release v${{ github.event.inputs.version }}
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-ruby-and-dependencies
with:
ruby-version: "4.0"
cache-apt-packages: true
- name: Verify version
run: |
GEM_VERSION="${{ github.event.inputs.version }}"
CODE_VERSION=$(ruby -I lib -r capybara/screenshot/diff/version -e "puts Capybara::Screenshot::Diff::VERSION")
if [ "$GEM_VERSION" != "$CODE_VERSION" ]; then
echo "Version mismatch: input=$GEM_VERSION code=$CODE_VERSION"
exit 1
fi
- name: Test
run: bundle exec rake test:unit
- name: Create tag
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag -a "v${{ github.event.inputs.version }}" -m "v${{ github.event.inputs.version }}"
git push origin "v${{ github.event.inputs.version }}"
- name: Publish to RubyGems
uses: rubygems/release-gem@v1
- name: Create GitHub Release
uses: softprops/action-gh-release@v3
with:
tag_name: "v${{ github.event.inputs.version }}"
name: "v${{ github.event.inputs.version }}"
body: |
## What's Changed
See [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/main/CHANGELOG.md#v${{ github.event.inputs.version }}) for full details.
**Upgrade Guide:** [docs/UPGRADING.md](https://github.com/${{ github.repository }}/blob/main/docs/UPGRADING.md)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}