Skip to content
Open
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
20 changes: 11 additions & 9 deletions .github/workflows/bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,40 +25,42 @@ jobs:
id: bump_version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NEW_VERSION: ${{ github.event.inputs.new_version }}
CHANGELOG: ${{ github.event.inputs.changelog }}
run: |
old_version=$(sed -e 's/.*=//' version.properties)
echo "Bumping old version: $old_version to new version ${{ github.event.inputs.new_version }}."
echo "Bumping old version: $old_version to new version $NEW_VERSION."
echo "Changelog:"
echo "- ${{ github.event.inputs.changelog }}"
echo "- $CHANGELOG"

echo "# ${{ github.event.inputs.new_version }}" >> new_CHANGELOG.md
echo "# $NEW_VERSION" >> new_CHANGELOG.md
echo >> new_CHANGELOG.md
echo "- ${{ github.event.inputs.changelog }}" >> new_CHANGELOG.md
echo "- $CHANGELOG" >> new_CHANGELOG.md
echo >> new_CHANGELOG.md
cat CHANGELOG.md >> new_CHANGELOG.md
mv new_CHANGELOG.md CHANGELOG.md

sed -i -e "s/$old_version/${{ github.event.inputs.new_version }}/" version.properties README.md
sed -i -e "s/$old_version/$NEW_VERSION/" version.properties README.md

echo "version=${{ github.event.inputs.new_version }}" > version.properties
echo "version=$NEW_VERSION" > version.properties

git diff

git config --global user.name "${GITHUB_USER:-Automated Version Bump}"
git config --global user.email "${GITHUB_EMAIL:-rust-android-gradle@users.noreply.github.com}"

git add --all
git commit -m "Prep for releasing version ${{ github.event.inputs.new_version }}."
git commit -m "Prep for releasing version $NEW_VERSION."

git log -n 1

git tag "v${{ github.event.inputs.new_version }}"
git tag "v$NEW_VERSION"
remote="https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"

git push "${remote}" --follow-tags
git push "${remote}" --tags

echo "::set-output name=new_tag::v${{ github.event.inputs.new_version }}"
echo "::set-output name=new_tag::v$NEW_VERSION"

- name: Create release
id: create_release
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ jobs:
run: echo "::set-output name=matrix::$(cat plugin/build/build-resources/androidTestTasks.json)"

- name: debug
run: echo ${{ steps.setup-matrix.outputs.matrix }}
env:
MATRIX: ${{ steps.setup-matrix.outputs.matrix }}
run: echo $MATRIX

outputs:
matrix: ${{ steps.setup-matrix.outputs.matrix }}
Expand Down
Loading