diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 99517b65cd..b49064017f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -111,7 +111,6 @@ jobs: !contains(needs.*.result, 'cancelled') runs-on: ubuntu-latest outputs: - commit_sha: ${{ steps.gradle-push.outputs.commit_sha }} release_branch: ${{ needs.get-or-create-release-branch.outputs.release_branch }} steps: - uses: actions/checkout@v3 @@ -124,20 +123,18 @@ jobs: with: action: upgrade-gradle-properties action-arguments: ${{ inputs.semantic_version }} + - name: Download all artifacts + uses: ./smithy-rs/.github/actions/download-all-artifacts - name: Push gradle.properties changes id: gradle-push + working-directory: artifacts shell: bash env: SEMANTIC_VERSION: ${{ inputs.semantic_version }} DRY_RUN: ${{ inputs.dry_run }} run: | - if git diff-index --quiet HEAD; then - # The file was actually changed, we need to commit and push the changes - git commit gradle.properties --message "Upgrade the smithy-rs runtime crates version to ${SEMANTIC_VERSION}" - echo "Pushing upgraded gradle.properties commit..." - git push origin - fi - echo "commit_sha=$(git rev-parse HEAD)" > $GITHUB_OUTPUT + echo "Pushing upgraded gradle.properties commit..." + git push origin release: name: Release diff --git a/tools/ci-scripts/upgrade-gradle-properties b/tools/ci-scripts/upgrade-gradle-properties index 5ba010b244..8e65369e1a 100755 --- a/tools/ci-scripts/upgrade-gradle-properties +++ b/tools/ci-scripts/upgrade-gradle-properties @@ -6,4 +6,23 @@ set -eux -publisher upgrade-runtime-crates-version --version ${1} --gradle-properties-path smithy-rs/gradle.properties +SEMANTIC_VERSION="${1}" +SMITHY_RS_DIR="$(pwd)/smithy-rs" +ARTIFACTS_DIR="$(pwd)/artifacts" +mkdir -p "${ARTIFACTS_DIR}" + +pushd "${SMITHY_RS_DIR}" +publisher upgrade-runtime-crates-version --version "${SEMANTIC_VERSION}" +if git diff-index --quiet HEAD; then + # The file was actually changed, we need to commit the changes + git commit gradle.properties --message "Upgrade the smithy-rs runtime crates version to ${SEMANTIC_VERSION}" +fi +popd + +# Clone smithy-rs repo changes (changelog updates) into +# the `smithy-rs-release` artifact for push to GitHub +pushd "${ARTIFACTS_DIR}" +git clone "${SMITHY_RS_DIR}" +# Copy over the original remotes so that it's possible to push to `origin` +cp "${SMITHY_RS_DIR}/.git/config" .git/config +popd