-
Notifications
You must be signed in to change notification settings - Fork 1
75 lines (69 loc) · 2.19 KB
/
ci.yml
File metadata and controls
75 lines (69 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
name: CI/CD Pipeline
on: [push, pull_request]
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.4"
bundler-cache: true
- run: bundle exec rubocop
steep:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.4"
bundler-cache: true
- run: bundle exec rbs collection install
- run: bundle exec rake steep
test:
strategy:
matrix:
ruby: ["3.2", "3.3", "3.4", "head"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- run: bundle exec rake test
release:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Extract version from tag
id: extract_version
run: |
echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
echo "version_number=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Extract changelog entry
id: changelog
run: |
VERSION_NUMBER="${{ steps.extract_version.outputs.version_number }}"
# Extract the changelog entry for this version
awk "/^## \[$VERSION_NUMBER\]/{flag=1;next}/^## \[/{flag=0}flag" CHANGELOG.md > release_notes.md
# Check if we found content
if [ -s release_notes.md ]; then
echo "Found changelog entry for version $VERSION_NUMBER"
else
echo "No specific changelog entry found, using default"
echo "Release ${{ steps.extract_version.outputs.version }}" > release_notes.md
fi
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.extract_version.outputs.version }}
name: ${{ steps.extract_version.outputs.version }}
body_path: release_notes.md
draft: false
prerelease: false