Skip to content

Commit e26bd1d

Browse files
committed
ci: Fix release workflow
Closes #117
1 parent 12e2367 commit e26bd1d

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

.github/workflows/release-please.yaml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717

1818
steps:
1919
# Create/update release PR
20-
- uses: googleapis/release-please-action@v4
20+
- uses: google-github-actions/release-please-action@v4
2121
id: release
2222
with:
2323
# These are the necessary parameters for releasing multiple packages
@@ -27,10 +27,32 @@ jobs:
2727
manifest-file: .release-please-manifest.json
2828
monorepo-tags: true
2929

30+
- name: Compute tag name
31+
id: compute
32+
if: steps.release.outputs.releases_created
33+
run: |
34+
# For a monorepo, there may be multiple tags, so outputs.tag_name is
35+
# only used for releases of the root component. To get the tag name
36+
# generally, we need to check outputs.paths_released, and possibly
37+
# use that to construct the tag name. This seems like a major
38+
# failing of release-please-action, which could have a simple output
39+
# with an arbitrary tag name for situations like this.
40+
json="${{ toJSON(steps.release.outputs) }}"
41+
# This is a tag from the root component, if any.
42+
tag_name=$(echo "$json" | jq -r .tag_name)
43+
if [[ "$tag_name" == "" ]]; then
44+
# We don't care about every single tag. We just care about one tag
45+
# so we can check out the appropriate code from the repo. So grab
46+
# path [0].
47+
path=$(echo "$json" | jq -r .paths_released[0])
48+
tag_name=$(echo "$json" | jq -r ".$path--tag_name")
49+
fi
50+
echo "tag_name=$tag_name" >> $GITHUB_OUTPUT
51+
3052
- name: Checkout code
3153
uses: actions/checkout@v4
3254
with:
33-
ref: refs/tags/${{ steps.release.outputs.tag_name }}
55+
ref: refs/tags/${{ steps.compute.outputs.tag_name }}
3456
persist-credentials: false
3557
if: steps.release.outputs.releases_created
3658

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
"backends/chromecast": "2.0.0",
44
"backends/chromeos": "1.0.4",
55
"backends/tizen": "2.0.0",
6-
"backends/xboxone": "1.0.5"
6+
"backends/xboxone": "1.0.4"
77
}

0 commit comments

Comments
 (0)