Skip to content

Commit

Permalink
Add metafile.json to track version and checksum of artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
harrryr committed Dec 9, 2024
1 parent 425264c commit 8718ae0
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 5 deletions.
22 changes: 20 additions & 2 deletions .github/workflows/post-release-version-bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,27 @@ jobs:
sed -i'' -e "s/\"version\": \".*\"/\"version\": \"${DEV_VERSION}\"/" package.json
VERSION="${{ github.event.inputs.version }}"
npm install
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
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
git add .
git status
- name: Append latest release checksum to release-build-metadata.json
run: |
ARTIFACT_NAME="aws-aws-distro-opentelemetry-node-autoinstrumentation-${{ github.event.inputs.version }}.tgz"
curl -L -o $ARTIFACT_NAME https://github.com/aws-observability/aws-otel-js-instrumentation/releases/download/v${{ github.event.inputs.version }}/$ARTIFACT_NAME
CHECKSUM=$(shasum -a 256 $ARTIFACT_NAME | awk '{ print $1 }')
FILE="release-build-metadata.json"
UPDATED_JSON=$(jq --arg version "${{ env.VERSION }}" \
--arg name "$ARTIFACT_NAME" \
--arg checksum "$CHECKSUM" \
'.release += [{"version": $version, "checksum": [{"name": $name, "checksum": $checksum}]}]' "$FILE")
echo "$UPDATED_JSON" > "$FILE"
git add release-build-metadata.json
- name: Push changes to Github
run: |
git commit -m "Prepare main for next development cycle: Update version to $DEV_VERSION"
git push --set-upstream origin "prepare-main-for-next-dev-cycle-${VERSION}"
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,4 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
NPM_CONFIG_PROVENANCE: true
run: npx lerna publish from-package --no-push --no-private --no-git-tag-version --no-verify-access --yes


run: npx lerna publish from-package --no-push --no-private --no-git-tag-version --no-verify-access --yes
Empty file added checksum.txt
Empty file.
13 changes: 13 additions & 0 deletions release-build-metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"release": [
{
"version": "0.3.0",
"checksum": [
{
"name": "aws-aws-distro-opentelemetry-node-autoinstrumentation-0.3.0.tgz",
"checksum": "22f0aabe7a24f57769c994acd57031caafbdbde46b3ca396372499055a7cb76c"
}
]
}
]
}
Empty file added version.txt
Empty file.

0 comments on commit 8718ae0

Please sign in to comment.