mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-04-24 19:39:11 +00:00
ci: another manifest.json generation attempt
This commit is contained in:
parent
34c4039517
commit
1803cd3c6c
2 changed files with 8 additions and 27 deletions
9
.github/workflows/build.yml
vendored
9
.github/workflows/build.yml
vendored
|
@ -43,7 +43,14 @@ jobs:
|
|||
|
||||
- name: Write Artifact Manifest
|
||||
run: |
|
||||
bash hack/generate_versions.sh > manifest.json
|
||||
artifacts=$(${GITHUB_WORKSPACE}/bin/bazel query //src/... | grep +publish)
|
||||
publishedServices=${artifacts//$'//src/'/}
|
||||
publishedServices=${publishedServices//$':+publish'/}
|
||||
manifestJSON='{"services": {}}'
|
||||
for svc in $publishedServices; do
|
||||
manifestJSON=$(echo $manifestJSON | jq ".services+={\"$svc\":\"$(cat bazel-bin/src/$svc/+publish.digest)\"}")
|
||||
done
|
||||
echo $manifestJSON > manifest.json
|
||||
|
||||
- name: Upload Artifact Manifest
|
||||
uses: actions/upload-artifact@v2
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
BAZEL=${BAZEL:-bazel}
|
||||
artifacts=$($BAZEL query //src/... 2>/dev/null | grep +publish)
|
||||
publishedServices=${artifacts//$'//src/'/}
|
||||
publishedServices=${publishedServices//$':+publish'/}
|
||||
|
||||
artifactList=$'{ "services": {} }'
|
||||
|
||||
getSha() {
|
||||
service=$1
|
||||
cat ./bazel-bin/src/$service/+publish.digest
|
||||
}
|
||||
|
||||
addShaToServiceList() {
|
||||
service=$1
|
||||
shaSum=$2
|
||||
artifactList=$(echo $artifactList | jq ".services+={\"${service}\":\"${shaSum}\"}")
|
||||
}
|
||||
|
||||
for service in $publishedServices; do
|
||||
shaSum=$(getSha $service)
|
||||
test $shaSum && addShaToServiceList $service $shaSum
|
||||
done
|
||||
|
||||
echo $artifactList | jq
|
Loading…
Add table
Reference in a new issue