diff --git a/.github/workflows/make_release.yml b/.github/workflows/make_release.yml index 41d0f15..6c0e072 100644 --- a/.github/workflows/make_release.yml +++ b/.github/workflows/make_release.yml @@ -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) @@ -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]' @@ -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 @@ -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 }} @@ -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 }} diff --git a/.github/workflows/publish_release.yml b/.github/workflows/publish_release.yml index c2397d0..7791755 100644 --- a/.github/workflows/publish_release.yml +++ b/.github/workflows/publish_release.yml @@ -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: @@ -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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e773ce..8ea364e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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: diff --git a/Cargo.toml b/Cargo.toml index f64da4c..a5e9927 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ resolver = "2" members = ["bevy_tween_lookup_curve"] [workspace.package] -version = "0.13.0" +version = "0.14.0" edition = "2024" authors = ["Multirious", "Rabbival"] license = "MIT OR Apache-2.0" @@ -25,7 +25,7 @@ categories = ["game-development"] [workspace.dependencies] bevy = { version = "0.20.0", default-features = false } -bevy_tween = { path = "." } +bevy_tween = { version = "0.14.0", path = "." } tracing = { version = "0.1.41", features = ["std"] } [dependencies] diff --git a/README.md b/README.md index f0dfd3c..750bfb9 100644 --- a/README.md +++ b/README.md @@ -111,6 +111,7 @@ How it works: | `bevy` | `bevy_tween` | |--------|--------------| +| 0.20 | 0.14 | | 0.19 | 0.13 | | 0.18 | 0.12 | | 0.17 | 0.10–0.11 |