-
Notifications
You must be signed in to change notification settings - Fork 5
108 lines (98 loc) · 3.66 KB
/
release-please.yml
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: Run Release Please
on:
workflow_dispatch:
push:
branches:
- main
jobs:
release-please:
runs-on: ubuntu-latest
permissions:
pull-requests: write # Needed to create the release PR
contents: write # Needed to generate the release
outputs:
release_created: ${{ steps.release.outputs.release_created }}
prs_created: ${{ steps.release.outputs.prs_created }}
pr_branch_name: ${{ steps.release.outputs.prs_created == 'true' && fromJSON(steps.release.outputs.pr).headBranchName || '' }}
steps:
- uses: google-github-actions/release-please-action@v4
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
target-branch: ${{ github.ref_name }}
rockspec-info:
needs: release-please
uses: ./.github/workflows/rockspec-info.yml
update-release-pr:
needs: release-please
if: ${{ needs.release-please.outputs.prs_created == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Update launchdarkly-server-sdk rockspec
uses: ./.github/actions/update-versions
with:
package: launchdarkly-server-sdk
branch: ${{ needs.release-please.outputs.pr_branch_name }}
- name: Update launchdarkly-server-sdk-redis rockspec
uses: ./.github/actions/update-versions
with:
package: launchdarkly-server-sdk-redis
branch: ${{ needs.release-please.outputs.pr_branch_name }}
publish-docs:
permissions:
contents: write # Needed to publish to Github Pages
needs: release-please
if: ${{ needs.release-please.outputs.release_created == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build documentation
uses: ./.github/actions/build-docs
- name: Publish docs
uses: ./.github/actions/publish-docs
with:
token: ${{ secrets.GITHUB_TOKEN }}
publish-server:
permissions: # Needed for access to the LuaRocks token
id-token: write
contents: read
needs: [release-please, rockspec-info]
if: ${{ needs.release-please.outputs.release_created == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: launchdarkly/gh-actions/actions/[email protected]
name: 'Get LuaRocks token'
with:
aws_assume_role: ${{ vars.AWS_ROLE_ARN }}
ssm_parameter_pairs: '/production/common/releasing/luarocks/token = LUAROCKS_API_TOKEN'
- uses: ./.github/actions/ci
with:
rockspec: ${{ fromJSON(needs.rockspec-info.outputs.info).server.rockspec }}
- uses: ./.github/actions/publish
name: Publish server package
with:
dry_run: 'false'
rockspec: ${{ fromJSON(needs.rockspec-info.outputs.info).server.rockspec }}
publish-redis:
permissions: # Needed for access to the LuaRocks token
id-token: write
contents: read
needs: [ publish-server, rockspec-info ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: launchdarkly/gh-actions/actions/[email protected]
name: 'Get LuaRocks token'
with:
aws_assume_role: ${{ vars.AWS_ROLE_ARN }}
ssm_parameter_pairs: '/production/common/releasing/luarocks/token = LUAROCKS_API_TOKEN'
- uses: ./.github/actions/ci
with:
rockspec: ${{ fromJSON(needs.rockspec-info.outputs.info).redis.rockspec }}
- uses: ./.github/actions/publish
name: Publish redis package
with:
dry_run: 'false'
rockspec: ${{ fromJSON(needs.rockspec-info.outputs.info).redis.rockspec }}