Skip to content

Commit 2a087cf

Browse files
authored
ci: fix invocation of ci workflow from manual-publish (#67)
1 parent 346ac91 commit 2a087cf

File tree

1 file changed

+20
-40
lines changed

1 file changed

+20
-40
lines changed

.github/workflows/manual-publish.yml

Lines changed: 20 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ name: Publish Package
22
on:
33
workflow_dispatch:
44
inputs:
5-
rockspec:
5+
package:
66
type: choice
77
description: 'What to publish?'
88
options:
9-
- server
10-
- redis
11-
- both
9+
- '["server","redis"]'
10+
- '["server"]'
11+
- '["redis"]'
1212
dry_run:
1313
description: "Dry run? If checked, don't publish."
1414
type: boolean
@@ -26,14 +26,18 @@ on:
2626
default: false
2727

2828
jobs:
29-
rockspecs:
29+
rockspec-info:
3030
uses: ./.github/workflows/rockspec-info.yml
3131

3232
build-publish:
33-
needs: rockspecs
33+
needs: rockspec-info
3434
runs-on: ubuntu-latest
3535

36-
# Needed for AWS SSM access.
36+
strategy:
37+
fail-fast: true
38+
matrix:
39+
package: ${{ fromJSON(inputs.package) }}
40+
# Needed for AWS SSM access to get the LuaRocks token.
3741
permissions:
3842
id-token: write
3943
contents: read
@@ -46,44 +50,20 @@ jobs:
4650
aws_assume_role: ${{ vars.AWS_ROLE_ARN }}
4751
ssm_parameter_pairs: '/production/common/releasing/luarocks/token = LUAROCKS_API_TOKEN'
4852

49-
- uses: ./.github/actions/ci
50-
with:
51-
server-rockspec: ${{ needs.rockspecs.outputs.server }}
52-
redis-rockspec: ${{ needs.rockspecs.outputs.server_redis }}
53+
- name: Get package name
54+
id: pkg-info
55+
run: |
56+
rockspec=$(echo ${{ needs.rockspec-info.outputs.info }} | jq '.${{ matrix.package }}.rockspec')
57+
echo "package=$rockspec" >> $GITHUB_OUTPUT
5358
54-
- uses: ./.github/actions/publish
55-
name: ${{ format('Publish launchdarkly-server-sdk @ {0}', needs.rockspecs.outputs.server_version) }}
56-
if: ${{ inputs.rockspec == 'server' || inputs.rockspec == 'both' }}
59+
- uses: ./.github/actions/ci
5760
with:
58-
dry_run: ${{ inputs.dry_run }}
59-
rockspec: ${{ needs.rockspecs.outputs.server }}
60-
skip_pack: ${{ inputs.skip_pack }}
61-
force: ${{ inputs.force }}
61+
rockspec: ${{ steps.pkg-info.outputs.package }}
6262

6363
- uses: ./.github/actions/publish
64-
name: ${{ format('Publish launchdarkly-server-sdk-redis @ {0}', needs.rockspecs.outputs.server_redis_version) }}
65-
if: ${{ inputs.rockspec == 'redis' || inputs.rockspec == 'both'}}
64+
name: ${{ format('Publish {0}', steps.pkg-info.outputs.package) }}
6665
with:
6766
dry_run: ${{ inputs.dry_run }}
68-
rockspec: ${{ needs.rockspecs.outputs.server_redis }}
67+
rockspec: ${{ steps.pkg-info.outputs.package }}
6968
skip_pack: ${{ inputs.skip_pack }}
7069
force: ${{ inputs.force }}
71-
72-
install-server-sdk:
73-
name: ${{ format('Install launchdarkly-server-sdk @ {0}', needs.rockspecs.outputs.server_version) }}
74-
needs: [rockspecs, build-publish]
75-
if: ${{ inputs.rockspec == 'server' || inputs.rockspec == 'both' }}
76-
uses: ./.github/workflows/install-lua-sdk.yml
77-
with:
78-
package: launchdarkly-server-sdk
79-
version: ${{ needs.rockspecs.outputs.server_version }}
80-
81-
82-
install-server-redis:
83-
name: ${{ format('Install launchdarkly-server-sdk-redis @ {0}', needs.rockspecs.outputs.server_redis_version) }}
84-
needs: [rockspecs, build-publish]
85-
if: ${{ inputs.rockspec == 'redis' || inputs.rockspec == 'both' }}
86-
uses: ./.github/workflows/install-lua-sdk.yml
87-
with:
88-
package: launchdarkly-server-sdk-redis
89-
version: ${{ needs.rockspecs.outputs.server_redis_version }}

0 commit comments

Comments
 (0)