Skip to content
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
40 changes: 35 additions & 5 deletions .github/workflows/make_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ on:
required: true
type: string
default: 0.1.0
readme_version:
description: Version of the new release in readme.
required: true
type: string
default: 0.1
bevy_version:
description: |
Bevy version this release uses. (No patch version needed)
Expand All @@ -25,6 +30,26 @@ jobs:
with:
token: ${{ secrets.TOKEN }}

- uses: actions/cache@v6
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cargo/.crates.toml
~/.cargo/.crates2.json
target/
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.toml') }}

- uses: dtolnay/rust-toolchain@stable

- name: Install toml-cli
run: |
curl -OL https://github.com/gnprice/toml-cli/releases/download/v0.2.3/toml-0.2.3-x86_64-linux.tar.gz
tar -xf toml-0.2.3-x86_64-linux.tar.gz
mv toml-0.2.3-x86_64-linux/toml .

- name: Setup Git
run: |
git config --global user.name 'github-actions[bot]'
Expand All @@ -48,7 +73,7 @@ jobs:

- name: Update README.md bevy version support table
run: |
row=$(printf "| %-6s | %-12s |" '${{ inputs.bevy_version }}' '${{ inputs.version }}' )
row=$(printf "| %-6s | %-12s |" '${{ inputs.bevy_version }}' '${{ inputs.readme_version }}' )
sed -zi \
"s/## Bevy Version Support\n\n| \`bevy\` | \`bevy_tween\` |\n|--------|--------------|\n/&$row\n/; t; q1" \
README.md
Expand All @@ -57,13 +82,16 @@ jobs:

- name: Update Cargo.toml version
run: |
# Only replace the first match, which should be ours.
sed -zi \
's/version = "[^"]*"/version = "${{ inputs.version }}"/; t; q1' \
Cargo.toml
echo "$(./toml set Cargo.toml "workspace.package.version" '${{ inputs.version }}')" > Cargo.toml
echo "$(./toml set Cargo.toml "workspace.dependencies.bevy_tween.version" '${{ inputs.version }}')" > Cargo.toml

git add Cargo.toml
git commit -m 'Update Cargo.toml version'

cargo update
git add Cargo.lock
git commit -m 'Update Cargo.lock'

- name: Create Pull Request
env:
GH_TOKEN: ${{ secrets.TOKEN }}
Expand All @@ -72,6 +100,8 @@ jobs:
Make release for v${{ inputs.version }}

This PR was automatically generated by a GitHub Actions workflow.

?publish_release v${{ inputs.version }}
run: |
git push origin release-v${{ inputs.version }}

Expand Down
47 changes: 37 additions & 10 deletions .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,53 @@ name: Publish Release

on:
push:
tags:
- v*

jobs:
publish-release:
runs-on: ubuntu-latest
if: "contains(github.event.head_commit.message, '?publish_release')"

steps:
- uses: actions/checkout@v7
with:
token: ${{ secrets.TOKEN }}

- uses: actions/cache@v6
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cargo/.crates.toml
~/.cargo/.crates2.json
target/
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.toml') }}

- uses: dtolnay/rust-toolchain@stable

- name: Get release version
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Setup Git
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git switch -c 'release-v${{ inputs.version }}'

- name: Get release version
run: |
message="${{ github.event.head_commit.message }}"
version="$(echo "$message" | sed -zn "s/.*?publish_release \(v\S*\).*/\1/p; t; q1")"
echo "RELEASE_VERSION=$version" >> $GITHUB_ENV

- name: Publish to crates.io
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATESIO_TOKEN }}
run: |
cargo publish --workspace

- name: Tag commit
run: |
git tag "$RELEASE_VERSION" -m "Release $RELEASE_VERSION"
git push origin tag "$RELEASE_VERSION"

- name: Create Release
env:
Expand All @@ -28,9 +61,3 @@ jobs:
gh release create $RELEASE_VERSION \
--title "Release $RELEASE_VERSION"\
--notes "$current_changelog" || true

- name: Publish to crates.io
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATESIO_TOKEN }}
run: |
cargo publish
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/target
/.envrc
/.direnv

Cargo.lock
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased - XXXX-XX-XX

## v0.14.0 - 2026-10-25

- Migrate to Bevy v0.20.0 by [#97](https://github.com/Multirious/bevy_tween/pull/97)

Breaking:
Expand Down
Loading
Loading