Skip to content

Commit 88598bd

Browse files
committed
simplify the publish process
1 parent 43b8b2a commit 88598bd

4 files changed

Lines changed: 35 additions & 51 deletions

File tree

.github/actions/ci/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ runs:
1818

1919
- name: Run tests
2020
shell: bash
21-
run: bundle exec rspec spec $SPEC_TAGS
21+
run: bundle exec rspec spec
2222

2323
- name: Run RuboCop
2424
shell: bash
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
name: Publish Package
22
on:
3+
workflow_call:
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+
tag_name:
10+
description: 'The tag name to use for the provenance file'
11+
type: string
12+
required: true
13+
314
workflow_dispatch:
415
inputs:
516
dry_run:
@@ -31,12 +42,21 @@ jobs:
3142
with:
3243
ruby-version: 3.0
3344

45+
- id: build-docs
46+
name: Build docs
47+
uses: ./.github/actions/build-docs
48+
3449
- id: publish
3550
name: Publish Package
3651
uses: ./.github/actions/publish
3752
with:
3853
dry_run: ${{ inputs.dry_run }}
3954

55+
- uses: ./.github/actions/publish-docs
56+
if: ${{ steps.release.outputs.releases_created == 'true' }}
57+
with:
58+
token: ${{secrets.GITHUB_TOKEN}}
59+
4060
release-provenance:
4161
needs: [ 'build-publish' ]
4262
permissions:
@@ -47,3 +67,5 @@ jobs:
4767
with:
4868
base64-subjects: "${{ needs.build-publish.outputs.gem-hash }}"
4969
upload-assets: ${{ !inputs.dry_run }}
70+
upload-tag-name: ${{ needs.release-package.outputs.upload-tag-name }}
71+
provenance-name: ${{ format('{0}_provenance.intoto.jsonl', inputs.tag_name) }}
Lines changed: 10 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,27 @@
1-
name: Run Release Please
1+
name: Release Please
22

33
on:
44
push:
55
branches:
66
- main
77

88
jobs:
9-
release-package:
9+
release-please:
1010
runs-on: ubuntu-latest
1111
permissions:
12-
id-token: write # Needed if using OIDC to get release secrets.
1312
contents: write # Contents and pull-requests are for release-please to make releases.
1413
pull-requests: write
1514
outputs:
1615
release-created: ${{ steps.release.outputs.release_created }}
17-
upload-tag-name: ${{ steps.release.outputs.tag_name }}
18-
gem-hash: ${{ steps.publish.outputs.gem-hash}}
16+
tag-name: ${{ steps.release.outputs.tag_name }}
1917
steps:
2018
- uses: googleapis/release-please-action@v4
2119
id: release
22-
23-
- uses: actions/checkout@v4
24-
if: ${{ steps.release.outputs.releases_created == 'true' }}
25-
with:
26-
fetch-depth: 0 # If you only need the current version keep this.
27-
28-
- uses: launchdarkly/gh-actions/actions/release-secrets@release-secrets-v1.2.0
29-
if: ${{ steps.release.outputs.releases_created == 'true' }}
30-
name: 'Get rubygems API key'
31-
with:
32-
aws_assume_role: ${{ vars.AWS_ROLE_ARN }}
33-
ssm_parameter_pairs: '/production/common/releasing/rubygems/api_key = GEM_HOST_API_KEY'
34-
35-
- uses: ./.github/actions/ci
36-
if: ${{ steps.release.outputs.releases_created == 'true' }}
37-
with:
38-
ruby-version: 3.0
39-
40-
- uses: ./.github/actions/build-docs
41-
if: ${{ steps.release.outputs.releases_created == 'true' }}
42-
43-
- uses: ./.github/actions/publish
44-
id: publish
45-
if: ${{ steps.release.outputs.releases_created == 'true' }}
46-
with:
47-
dry_run: false
48-
49-
- uses: ./.github/actions/publish-docs
50-
if: ${{ steps.release.outputs.releases_created == 'true' }}
51-
with:
52-
token: ${{secrets.GITHUB_TOKEN}}
53-
54-
release-provenance:
55-
needs: [ 'release-package' ]
56-
if: ${{ needs.release-package.outputs.release-created == 'true' }}
57-
permissions:
58-
actions: read
59-
id-token: write
60-
contents: write
61-
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v2.0.0
20+
21+
release-sdk:
22+
needs: release-please
23+
if: ${{ needs.release-please.outputs.release-created == 'true' }}
24+
uses: ./.github/workflows/publish.yml
6225
with:
63-
base64-subjects: "${{ needs.release-package.outputs.gem-hash }}"
64-
upload-assets: true
65-
upload-tag-name: ${{ needs.release-package.outputs.upload-tag-name }}
26+
dry_run: false
27+
tag_name: ${{ needs.release-please.outputs.tag-name }}

docs/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ifeq ($(LD_RELEASE_VERSION),)
2-
TITLE=LaunchDarkly Ruby AI Library
2+
TITLE=LaunchDarkly Ruby Server SDK AI Library
33
else
4-
TITLE=LaunchDarkly Ruby AI Library ($(LD_RELEASE_VERSION))
4+
TITLE=LaunchDarkly Ruby Server SDK AI Library ($(LD_RELEASE_VERSION))
55
endif
66

77
.PHONY: dependencies html

0 commit comments

Comments
 (0)