diff --git a/.github/workflows/post-release-version-bump.yml b/.github/workflows/post-release-version-bump.yml index 00b5e72..0b7266e 100644 --- a/.github/workflows/post-release-version-bump.yml +++ b/.github/workflows/post-release-version-bump.yml @@ -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}" diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index 24589df..8abfe67 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -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 - - \ No newline at end of file + run: npx lerna publish from-package --no-push --no-private --no-git-tag-version --no-verify-access --yes \ No newline at end of file diff --git a/release-build-metadata.json b/release-build-metadata.json new file mode 100644 index 0000000..63925b4 --- /dev/null +++ b/release-build-metadata.json @@ -0,0 +1,13 @@ +{ + "release": [ + { + "version": "0.3.0", + "checksum": [ + { + "name": "aws-aws-distro-opentelemetry-node-autoinstrumentation-0.3.0.tgz", + "checksum": "22f0aabe7a24f57769c994acd57031caafbdbde46b3ca396372499055a7cb76c" + } + ] + } + ] +} \ No newline at end of file