Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Persist the modified gradle.properties outside of the Docker context #2287

Merged
merged 4 commits into from
Feb 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
21 changes: 20 additions & 1 deletion tools/ci-scripts/upgrade-gradle-properties
Original file line number Diff line number Diff line change
Expand Up @@ -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