Skip to content

Commit 934c5ca

Browse files
authored
ci: publish packages with release-please (#68)
Updates `release-please` workflow to actually perform a release, in a similar manner to recently merged `manual-publish` workflow.
1 parent 2a087cf commit 934c5ca

File tree

2 files changed

+57
-14
lines changed

2 files changed

+57
-14
lines changed

.github/workflows/manual-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444

4545
steps:
4646
- uses: actions/checkout@v4
47-
- uses: launchdarkly/gh-actions/actions/release-secrets@release-secrets-v1.0.0
47+
- uses: launchdarkly/gh-actions/actions/release-secrets@release-secrets-v1.0.2
4848
name: 'Get LuaRocks token'
4949
with:
5050
aws_assume_role: ${{ vars.AWS_ROLE_ARN }}

.github/workflows/release-please.yml

Lines changed: 56 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,44 +7,87 @@ on:
77
- main
88

99
jobs:
10-
release-package:
10+
rockspec-info:
11+
uses: ./.github/workflows/rockspec-info.yml
12+
13+
release-please:
1114
runs-on: ubuntu-latest
1215

1316
permissions:
1417
contents: write # Contents and pull-requests are for release-please to make releases.
1518
pull-requests: write
1619

20+
outputs:
21+
release_created: ${{ steps.release.outputs.release_created }}
22+
prs_created: ${{ steps.release.outputs.prs_created }}
23+
pr_branch_name: ${{ steps.release.outputs.prs_created == 'true' && fromJSON(steps.release.outputs.pr).headBranchName || '' }}
1724
steps:
1825
- uses: google-github-actions/release-please-action@v4
1926
id: release
2027
with:
2128
token: ${{ secrets.GITHUB_TOKEN }}
2229

30+
update-release-pr:
31+
needs: release-please
32+
if: ${{ needs.release-please.outputs.prs_created == 'true' }}
33+
runs-on: ubuntu-latest
34+
steps:
2335
- uses: actions/checkout@v4
24-
2536
- name: Update launchdarkly-server-sdk rockspec
2637
uses: ./.github/actions/update-versions
27-
if: ${{ steps.release.outputs.prs_created == 'true' }}
2838
with:
2939
package: launchdarkly-server-sdk
30-
branch: ${{ fromJSON(steps.release.outputs.pr).headBranchName }}
40+
branch: ${{ needs.release-please.outputs.pr_branch_name }}
3141

3242
- name: Update launchdarkly-server-sdk-redis rockspec
3343
uses: ./.github/actions/update-versions
34-
if: ${{ steps.release.outputs.prs_created == 'true' }}
3544
with:
3645
package: launchdarkly-server-sdk-redis
37-
branch: ${{ fromJSON(steps.release.outputs.pr).headBranchName }}
38-
39-
- name: Build and Test
40-
if: ${{ steps.release.outputs.release_created == 'true' }}
41-
uses: ./.github/actions/ci
46+
branch: ${{ needs.release-please.outputs.pr_branch_name }}
4247

48+
publish-docs:
49+
needs: release-please
50+
if: ${{ needs.release-please.outputs.release_created == 'true' }}
51+
runs-on: ubuntu-latest
52+
steps:
53+
- uses: actions/checkout@v4
4354
- name: Build documentation
44-
if: ${{ steps.release.outputs.release_created == 'true' }}
4555
uses: ./.github/actions/build-docs
4656

47-
- uses: ./.github/actions/publish-docs
48-
if: ${{ steps.release.outputs.release_created == 'true' }}
57+
- name: Publish docs
58+
uses: ./.github/actions/publish-docs
4959
with:
5060
token: ${{ secrets.GITHUB_TOKEN }}
61+
62+
publish-server:
63+
needs: [release-please, rockspec-info]
64+
if: ${{ needs.release-please.outputs.release_created == 'true' }}
65+
runs-on: ubuntu-latest
66+
steps:
67+
- uses: actions/checkout@v4
68+
- uses: launchdarkly/gh-actions/actions/release-secrets@release-secrets-v1.0.2
69+
name: 'Get LuaRocks token'
70+
with:
71+
aws_assume_role: ${{ vars.AWS_ROLE_ARN }}
72+
ssm_parameter_pairs: '/production/common/releasing/luarocks/token = LUAROCKS_API_TOKEN'
73+
- uses: ./.github/actions/publish
74+
name: Publish server package
75+
with:
76+
dry_run: 'false'
77+
rockspec: ${{ fromJSON(needs.rockspec-info.outputs.info).server }}
78+
79+
publish-redis:
80+
needs: [ publish-server, rockspec-info ]
81+
runs-on: ubuntu-latest
82+
steps:
83+
- uses: actions/checkout@v4
84+
- uses: launchdarkly/gh-actions/actions/release-secrets@release-secrets-v1.0.2
85+
name: 'Get LuaRocks token'
86+
with:
87+
aws_assume_role: ${{ vars.AWS_ROLE_ARN }}
88+
ssm_parameter_pairs: '/production/common/releasing/luarocks/token = LUAROCKS_API_TOKEN'
89+
- uses: ./.github/actions/publish
90+
name: Publish redis package
91+
with:
92+
dry_run: 'false'
93+
rockspec: ${{ fromJSON(needs.rockspec-info.outputs.info).redis }}

0 commit comments

Comments
 (0)