Skip to content

Commit e1c63f1

Browse files
authored
ci: remove rockspec-info.yml from release-please extra-files (#79)
This should _actually_ fix release please! The root cause of the errors seems to have been that you cannot update a Github workflow file using `extra-files` in a release please manifest. This is disallowed by the Github API. I've refactored the `rockspec-info` workflow to not need to be updated at all. Instead, it grabs the current version from the existing `.release-please-manifest`. I should have done this in the first place as it's much cleaner.
1 parent 85cdab1 commit e1c63f1

File tree

3 files changed

+94
-9
lines changed

3 files changed

+94
-9
lines changed

.github/workflows/release-please.yml

Lines changed: 87 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,94 @@ on:
99
jobs:
1010
release-please:
1111
runs-on: ubuntu-latest
12+
permissions:
13+
pull-requests: write # Needed to create the release PR
14+
contents: write # Needed to generate the release
15+
16+
outputs:
17+
release_created: ${{ steps.release.outputs.release_created }}
18+
prs_created: ${{ steps.release.outputs.prs_created }}
19+
pr_branch_name: ${{ steps.release.outputs.prs_created == 'true' && fromJSON(steps.release.outputs.pr).headBranchName || '' }}
1220
steps:
13-
- uses: cwaldren-ld/release-please-action@c20bc7716919838e71934160b59925db0b3e59af
21+
- uses: google-github-actions/release-please-action@v4
1422
id: release
1523
with:
1624
token: ${{ secrets.GITHUB_TOKEN }}
25+
target-branch: ${{ github.ref_name }}
26+
27+
rockspec-info:
28+
needs: release-please
29+
uses: ./.github/workflows/rockspec-info.yml
30+
31+
update-release-pr:
32+
needs: release-please
33+
if: ${{ needs.release-please.outputs.prs_created == 'true' }}
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v4
37+
- name: Update launchdarkly-server-sdk rockspec
38+
uses: ./.github/actions/update-versions
39+
with:
40+
package: launchdarkly-server-sdk
41+
branch: ${{ needs.release-please.outputs.pr_branch_name }}
42+
43+
- name: Update launchdarkly-server-sdk-redis rockspec
44+
uses: ./.github/actions/update-versions
45+
with:
46+
package: launchdarkly-server-sdk-redis
47+
branch: ${{ needs.release-please.outputs.pr_branch_name }}
48+
49+
publish-docs:
50+
permissions:
51+
contents: write # Needed to publish to Github Pages
52+
needs: release-please
53+
if: ${{ needs.release-please.outputs.release_created == 'true' }}
54+
runs-on: ubuntu-latest
55+
steps:
56+
- uses: actions/checkout@v4
57+
- name: Build documentation
58+
uses: ./.github/actions/build-docs
59+
60+
- name: Publish docs
61+
uses: ./.github/actions/publish-docs
62+
with:
63+
token: ${{ secrets.GITHUB_TOKEN }}
64+
65+
publish-server:
66+
permissions: # Needed for access to the LuaRocks token
67+
id-token: write
68+
contents: read
69+
needs: [release-please, rockspec-info]
70+
if: ${{ needs.release-please.outputs.release_created == 'true' }}
71+
runs-on: ubuntu-latest
72+
steps:
73+
- uses: actions/checkout@v4
74+
- uses: launchdarkly/gh-actions/actions/release-secrets@release-secrets-v1.0.2
75+
name: 'Get LuaRocks token'
76+
with:
77+
aws_assume_role: ${{ vars.AWS_ROLE_ARN }}
78+
ssm_parameter_pairs: '/production/common/releasing/luarocks/token = LUAROCKS_API_TOKEN'
79+
- uses: ./.github/actions/publish
80+
name: Publish server package
81+
with:
82+
dry_run: 'false'
83+
rockspec: ${{ fromJSON(needs.rockspec-info.outputs.info).server }}
84+
85+
publish-redis:
86+
permissions: # Needed for access to the LuaRocks token
87+
id-token: write
88+
contents: read
89+
needs: [ publish-server, rockspec-info ]
90+
runs-on: ubuntu-latest
91+
steps:
92+
- uses: actions/checkout@v4
93+
- uses: launchdarkly/gh-actions/actions/release-secrets@release-secrets-v1.0.2
94+
name: 'Get LuaRocks token'
95+
with:
96+
aws_assume_role: ${{ vars.AWS_ROLE_ARN }}
97+
ssm_parameter_pairs: '/production/common/releasing/luarocks/token = LUAROCKS_API_TOKEN'
98+
- uses: ./.github/actions/publish
99+
name: Publish redis package
100+
with:
101+
dry_run: 'false'
102+
rockspec: ${{ fromJSON(needs.rockspec-info.outputs.info).redis }}

.github/workflows/rockspec-info.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,24 @@ on:
66
description: "JSON object with rockspec info"
77
value: ${{ jobs.rockspec-info.outputs.info }}
88

9-
env:
10-
LUA_SERVER_VERSION: "2.0.2" # {x-release-please-version}
11-
LUA_SERVER_REDIS_VERSION: "2.0.2" # {x-release-please-version}
12-
13-
149
jobs:
1510
rockspec-info:
1611
runs-on: ubuntu-latest
1712
outputs:
1813
info: ${{ steps.pkg-info.outputs.info }}
1914
steps:
2015
- uses: actions/checkout@v4
16+
- name: Fetch release please manifest
17+
id: manifest
18+
run: |
19+
version=$(jq '."."' < .release-please-manifest.json)
20+
echo "version=$version" >> $GITHUB_OUTPUT
2121
- name: Construct rockspec package names
2222
id: pkg-info
2323
run: |
2424
echo 'info<<EOF' >> $GITHUB_OUTPUT
2525
echo '"{' >> $GITHUB_OUTPUT
26-
echo '\"server\":{\"version\":\"${{ env.LUA_SERVER_VERSION}}\",\"rockspec\":\"launchdarkly-server-sdk-${{ env.LUA_SERVER_VERSION }}-0.rockspec\"},' >> $GITHUB_OUTPUT
27-
echo '\"redis\":{\"version\":\"${{ env.LUA_SERVER_REDIS_VERSION}}\",\"rockspec\":\"launchdarkly-server-sdk-redis-${{ env.LUA_SERVER_REDIS_VERSION }}-0.rockspec\"}' >> $GITHUB_OUTPUT
26+
echo '\"server\":{\"version\":\"${{ steps.manifest.outputs.version }}\",\"rockspec\":\"launchdarkly-server-sdk-${{ steps.manifest.outputs.version }}-0.rockspec\"},' >> $GITHUB_OUTPUT
27+
echo '\"redis\":{\"version\":\"${{ steps.manifest.outputs.version }}\",\"rockspec\":\"launchdarkly-server-sdk-redis-${{ steps.manifest.outputs.version }}-0.rockspec\"}' >> $GITHUB_OUTPUT
2828
echo '}"' >> $GITHUB_OUTPUT
2929
echo 'EOF' >> $GITHUB_OUTPUT

release-please-config.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"versioning": "default",
77
"extra-files": [
88
"launchdarkly-server-sdk.c",
9-
".github/workflows/rockspec-info.yml",
109
"README.md",
1110
"scripts/update-versions.sh",
1211
"scripts/compile.sh"

0 commit comments

Comments
 (0)