Skip to content

Commit 5627f3a

Browse files
authored
ci: Replace releaser with release please (#229)
1 parent e3266a5 commit 5627f3a

File tree

18 files changed

+301
-209
lines changed

18 files changed

+301
-209
lines changed

.circleci/config.yml

Lines changed: 0 additions & 153 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: Build Documentation
2+
description: 'Build Documentation.'
3+
4+
runs:
5+
using: composite
6+
steps:
7+
- name: Build Documentation
8+
shell: bash
9+
run: cd docs && make html

.github/actions/ci/action.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: CI Workflow
2+
description: 'Shared CI workflow.'
3+
inputs:
4+
ruby-version:
5+
description: 'The version of ruby to setup and run'
6+
required: true
7+
8+
runs:
9+
using: composite
10+
steps:
11+
- uses: ruby/setup-ruby@v1
12+
with:
13+
ruby-version: ${{ inputs.ruby-version }}
14+
bundler: 2.2.33
15+
16+
- name: Install dependencies
17+
shell: bash
18+
run: bundle _2.2.33_ install
19+
20+
- name: Skip flaky tests for jruby
21+
if: ${{ startsWith(inputs.ruby-version, 'jruby') }}
22+
shell: bash
23+
run: echo "SPEC_TAGS=-t '~flaky'" >> $GITHUB_ENV
24+
25+
- name: Run tests
26+
shell: bash
27+
run: bundle _2.2.33_ exec rspec spec $SPEC_TAGS
28+
29+
- name: Run RuboCop
30+
shell: bash
31+
run: bundle exec rubocop --parallel
32+
33+
- name: Run contract tests
34+
if: ${{ !startsWith(inputs.ruby-version, 'jruby') }}
35+
shell: bash
36+
run: make contract-tests
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Publish Documentation
2+
description: 'Publish the documentation to GitHub Pages'
3+
inputs:
4+
token:
5+
description: 'Token to use for publishing.'
6+
required: true
7+
8+
runs:
9+
using: composite
10+
steps:
11+
- uses: launchdarkly/gh-actions/actions/[email protected]
12+
name: 'Publish to Github pages'
13+
with:
14+
docs_path: docs/build/html/
15+
github_token: ${{inputs.token}} # For the shared action the token should be a GITHUB_TOKEN<

.github/actions/publish/action.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Publish Package
2+
description: 'Publish the package to rubygems'
3+
inputs:
4+
dry_run:
5+
description: 'Is this a dry run. If so no package will be published.'
6+
required: true
7+
8+
runs:
9+
using: composite
10+
steps:
11+
- name: Build gemspec
12+
shell: bash
13+
run: gem build ld-eventsource.gemspec
14+
15+
- name: Publish Library
16+
shell: bash
17+
if: ${{ inputs.dry_run == 'false' }}
18+
run: gem push ld-eventsource-*.gem

.github/workflows/ci.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Run CI
2+
on:
3+
push:
4+
branches: [ main ]
5+
paths-ignore:
6+
- '**.md' # Do not need to run CI for markdown changes.
7+
pull_request:
8+
branches: [ main ]
9+
paths-ignore:
10+
- '**.md'
11+
12+
jobs:
13+
build-linux:
14+
runs-on: ubuntu-latest
15+
16+
env:
17+
LD_SKIP_DATABASE_TESTS: 0
18+
19+
strategy:
20+
matrix:
21+
ruby-version:
22+
- '3.0'
23+
- '3.1'
24+
- '3.2'
25+
- jruby-9.4
26+
27+
services:
28+
redis:
29+
image: redis
30+
ports:
31+
- 6379:6379
32+
dynamodb:
33+
image: amazon/dynamodb-local
34+
ports:
35+
- 8000:8000
36+
consul:
37+
image: hashicorp/consul
38+
ports:
39+
- 8500:8500
40+
41+
steps:
42+
- uses: actions/checkout@v4
43+
with:
44+
fetch-depth: 0 # If you only need the current version keep this.
45+
46+
- uses: ./.github/actions/ci
47+
with:
48+
ruby-version: ${{ matrix.ruby-version }}
49+
50+
- uses: ./.github/actions/build-docs
51+
if: ${{ !startsWith(matrix.ruby-version, 'jruby') }}
52+
53+
build-windows:
54+
runs-on: windows-latest
55+
56+
env:
57+
LD_SKIP_DATABASE_TESTS: 1
58+
59+
defaults:
60+
run:
61+
shell: powershell
62+
63+
steps:
64+
- uses: actions/checkout@v4
65+
66+
- uses: ruby/setup-ruby@v1
67+
with:
68+
ruby-version: 3.0
69+
bundler: 2.2.33
70+
71+
- name: Install dependencies
72+
run: bundle _2.2.33_ install
73+
74+
- name: Run tests
75+
run: bundle _2.2.33_ exec rspec spec
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Lint PR title
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
10+
jobs:
11+
lint-pr-title:
12+
uses: launchdarkly/gh-actions/.github/workflows/lint-pr-title.yml@main
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
on:
2+
workflow_dispatch:
3+
4+
name: Publish Documentation
5+
jobs:
6+
build-publish-docs:
7+
runs-on: ubuntu-latest
8+
permissions:
9+
id-token: write # Needed if using OIDC to get release secrets.
10+
contents: write # Needed in this case to write github pages.
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- uses: ruby/setup-ruby@v1
15+
with:
16+
ruby-version: 3.0
17+
bundler: 2.2.33
18+
19+
- uses: ./.github/actions/build-docs
20+
21+
- uses: ./.github/actions/publish-docs
22+
with:
23+
token: ${{secrets.GITHUB_TOKEN}}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Publish Package
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
dry_run:
6+
description: 'Is this a dry run. If so no package will be published.'
7+
type: boolean
8+
required: true
9+
10+
jobs:
11+
build-publish:
12+
runs-on: ubuntu-latest
13+
# Needed to get tokens during publishing.
14+
permissions:
15+
id-token: write
16+
contents: read
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- uses: launchdarkly/gh-actions/actions/[email protected]
21+
name: 'Get rubygems API key'
22+
with:
23+
aws_assume_role: ${{ vars.AWS_ROLE_ARN }}
24+
ssm_parameter_pairs: '/production/common/releasing/rubygems/api_key = GEM_HOST_API_KEY'
25+
26+
- id: build-and-test
27+
name: Build and Test
28+
uses: ./.github/actions/ci
29+
with:
30+
ruby-version: 3.0
31+
32+
- id: publish
33+
name: Publish Package
34+
uses: ./.github/actions/publish
35+
with:
36+
dry_run: ${{ inputs.dry_run }}

0 commit comments

Comments
 (0)