|
7 | 7 | - main |
8 | 8 |
|
9 | 9 | jobs: |
10 | | - release-package: |
| 10 | + rockspec-info: |
| 11 | + uses: ./.github/workflows/rockspec-info.yml |
| 12 | + |
| 13 | + release-please: |
11 | 14 | runs-on: ubuntu-latest |
12 | 15 |
|
13 | 16 | permissions: |
14 | 17 | contents: write # Contents and pull-requests are for release-please to make releases. |
15 | 18 | pull-requests: write |
16 | 19 |
|
| 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 || '' }} |
17 | 24 | steps: |
18 | 25 | - uses: google-github-actions/release-please-action@v4 |
19 | 26 | id: release |
20 | 27 | with: |
21 | 28 | token: ${{ secrets.GITHUB_TOKEN }} |
22 | 29 |
|
| 30 | + update-release-pr: |
| 31 | + needs: release-please |
| 32 | + if: ${{ needs.release-please.outputs.prs_created == 'true' }} |
| 33 | + runs-on: ubuntu-latest |
| 34 | + steps: |
23 | 35 | - uses: actions/checkout@v4 |
24 | | - |
25 | 36 | - name: Update launchdarkly-server-sdk rockspec |
26 | 37 | uses: ./.github/actions/update-versions |
27 | | - if: ${{ steps.release.outputs.prs_created == 'true' }} |
28 | 38 | with: |
29 | 39 | package: launchdarkly-server-sdk |
30 | | - branch: ${{ fromJSON(steps.release.outputs.pr).headBranchName }} |
| 40 | + branch: ${{ needs.release-please.outputs.pr_branch_name }} |
31 | 41 |
|
32 | 42 | - name: Update launchdarkly-server-sdk-redis rockspec |
33 | 43 | uses: ./.github/actions/update-versions |
34 | | - if: ${{ steps.release.outputs.prs_created == 'true' }} |
35 | 44 | with: |
36 | 45 | 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 }} |
42 | 47 |
|
| 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 |
43 | 54 | - name: Build documentation |
44 | | - if: ${{ steps.release.outputs.release_created == 'true' }} |
45 | 55 | uses: ./.github/actions/build-docs |
46 | 56 |
|
47 | | - - uses: ./.github/actions/publish-docs |
48 | | - if: ${{ steps.release.outputs.release_created == 'true' }} |
| 57 | + - name: Publish docs |
| 58 | + uses: ./.github/actions/publish-docs |
49 | 59 | with: |
50 | 60 | 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