Skip to content

Commit 8718ae0

Browse files
committed
Add metafile.json to track version and checksum of artifacts
1 parent 425264c commit 8718ae0

File tree

5 files changed

+34
-5
lines changed

5 files changed

+34
-5
lines changed

.github/workflows/post-release-version-bump.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,27 @@ jobs:
107107
sed -i'' -e "s/\"version\": \".*\"/\"version\": \"${DEV_VERSION}\"/" package.json
108108
VERSION="${{ github.event.inputs.version }}"
109109
npm install
110-
sed -i "s|\(/aws-observability/adot-autoinstrumentation-node:\)v[0-9]\+\.[0-9]\+\.[0-9]\+|\1v${{github.event.inputs.version}}|g" .github/workflows/daily-scan.yml
110+
sed -i "s|\(/aws-observability/adot-autoinstrumentation-node:\)v[0-9]\+\.[0-9]\+\.[0-9]\+|\1v${{ github.event.inputs.version }}|g" .github/workflows/daily-scan.yml
111111
git add .
112-
git status
112+
113+
- name: Append latest release checksum to release-build-metadata.json
114+
run: |
115+
ARTIFACT_NAME="aws-aws-distro-opentelemetry-node-autoinstrumentation-${{ github.event.inputs.version }}.tgz"
116+
curl -L -o $ARTIFACT_NAME https://github.com/aws-observability/aws-otel-js-instrumentation/releases/download/v${{ github.event.inputs.version }}/$ARTIFACT_NAME
117+
118+
CHECKSUM=$(shasum -a 256 $ARTIFACT_NAME | awk '{ print $1 }')
119+
120+
FILE="release-build-metadata.json"
121+
UPDATED_JSON=$(jq --arg version "${{ env.VERSION }}" \
122+
--arg name "$ARTIFACT_NAME" \
123+
--arg checksum "$CHECKSUM" \
124+
'.release += [{"version": $version, "checksum": [{"name": $name, "checksum": $checksum}]}]' "$FILE")
125+
126+
echo "$UPDATED_JSON" > "$FILE"
127+
git add release-build-metadata.json
128+
129+
- name: Push changes to Github
130+
run: |
113131
git commit -m "Prepare main for next development cycle: Update version to $DEV_VERSION"
114132
git push --set-upstream origin "prepare-main-for-next-dev-cycle-${VERSION}"
115133

.github/workflows/release-build.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,4 @@ jobs:
103103
env:
104104
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
105105
NPM_CONFIG_PROVENANCE: true
106-
run: npx lerna publish from-package --no-push --no-private --no-git-tag-version --no-verify-access --yes
107-
108-
106+
run: npx lerna publish from-package --no-push --no-private --no-git-tag-version --no-verify-access --yes

checksum.txt

Whitespace-only changes.

release-build-metadata.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"release": [
3+
{
4+
"version": "0.3.0",
5+
"checksum": [
6+
{
7+
"name": "aws-aws-distro-opentelemetry-node-autoinstrumentation-0.3.0.tgz",
8+
"checksum": "22f0aabe7a24f57769c994acd57031caafbdbde46b3ca396372499055a7cb76c"
9+
}
10+
]
11+
}
12+
]
13+
}

version.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)