From 2eee29d0a5ae82efa7ef9722cd460b7e579388ec Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 7 Feb 2026 18:18:10 +0000 Subject: [PATCH 1/6] Initial plan From b835306491b946b4dc80fa29c7d7cf67f1a181bc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 7 Feb 2026 18:21:46 +0000 Subject: [PATCH 2/6] Add fully automated GitHub release process with manual trigger option Co-authored-by: joone <1979160+joone@users.noreply.github.com> --- .github/workflows/release.yml | 204 ++++++++++++++++++++++++++++++++++ CHANGELOG.md | 35 ++++++ RELEASING.md | 195 ++++++++++++++++++++++++++------ bump-version.sh | 134 ++++++++++++++++++++++ 4 files changed, 535 insertions(+), 33 deletions(-) create mode 100644 .github/workflows/release.yml create mode 100644 CHANGELOG.md create mode 100755 bump-version.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..bbb0667 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,204 @@ +name: Create Release + +on: + push: + tags: + - 'v[0-9]+\.[0-9]+\.[0-9]+' + workflow_dispatch: + inputs: + version: + description: 'Version to release (e.g., 0.2.9)' + required: true + type: string + create_tag: + description: 'Create and push git tag' + required: false + type: boolean + default: true + +env: + CARGO_TERM_COLOR: always + +jobs: + create-release: + runs-on: ubuntu-latest + permissions: + contents: write # Required for creating releases and tags + + outputs: + version: ${{ steps.get_version.outputs.version }} + upload_url: ${{ steps.create_release.outputs.upload_url }} + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 # Fetch all history for changelog generation + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + + - name: Install dependencies + run: sudo apt-get update && sudo apt-get install -y cmake libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libx11-dev libxext-dev + + - name: Get version + id: get_version + run: | + if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then + VERSION="${{ inputs.version }}" + echo "VERSION=$VERSION" >> $GITHUB_OUTPUT + echo "TAG_NAME=v$VERSION" >> $GITHUB_OUTPUT + echo "Manual release for version: $VERSION" + else + TAG_NAME=${GITHUB_REF#refs/tags/} + VERSION=${TAG_NAME#v} + echo "VERSION=$VERSION" >> $GITHUB_OUTPUT + echo "TAG_NAME=$TAG_NAME" >> $GITHUB_OUTPUT + echo "Tag-triggered release: $TAG_NAME" + fi + + - name: Verify Cargo.toml version matches + run: | + CARGO_VERSION=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[] | select(.name == "rust-animation") | .version') + RELEASE_VERSION="${{ steps.get_version.outputs.VERSION }}" + echo "Cargo.toml version: $CARGO_VERSION" + echo "Release version: $RELEASE_VERSION" + if [ "$CARGO_VERSION" != "$RELEASE_VERSION" ]; then + echo "::error::Version mismatch! Cargo.toml has $CARGO_VERSION but release version is $RELEASE_VERSION" + echo "Please update Cargo.toml version to $RELEASE_VERSION before creating a release" + exit 1 + fi + + - name: Create and push tag (manual trigger only) + if: github.event_name == 'workflow_dispatch' && inputs.create_tag + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git tag -a "${{ steps.get_version.outputs.TAG_NAME }}" -m "Release ${{ steps.get_version.outputs.TAG_NAME }}" + git push origin "${{ steps.get_version.outputs.TAG_NAME }}" + + - name: Run tests + run: cargo test --lib --verbose + + - name: Build + run: cargo build --release --verbose + + - name: Generate release notes + id: release_notes + run: | + # Extract changelog for this version + VERSION="${{ steps.get_version.outputs.VERSION }}" + + # Try to extract from CHANGELOG.md + if [ -f CHANGELOG.md ]; then + # Extract section for this version + NOTES=$(sed -n "/## \[$VERSION\]/,/## \[/p" CHANGELOG.md | sed '$d' | tail -n +2) + + if [ -z "$NOTES" ]; then + echo "No specific changelog entry found for version $VERSION" + NOTES="Release version $VERSION + +See [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/main/CHANGELOG.md) for details." + fi + else + # Generate basic release notes from recent commits + NOTES="Release version $VERSION + +## Changes in this release + +$(git log --pretty=format:"- %s" $(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || git rev-list --max-parents=0 HEAD)..HEAD 2>/dev/null || git log --pretty=format:"- %s" -10) + +--- +*See full changelog at [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/main/CHANGELOG.md)*" + fi + + # Save to file for multiline output + echo "$NOTES" > release_notes.txt + echo "Generated release notes" + + - name: Create GitHub Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ steps.get_version.outputs.TAG_NAME }} + release_name: Release ${{ steps.get_version.outputs.TAG_NAME }} + body_path: release_notes.txt + draft: false + prerelease: false + + - name: Publish to crates.io + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }} + run: cargo publish + + build-examples: + needs: create-release + runs-on: ${{ matrix.os }} + permissions: + contents: write + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + include: + - os: ubuntu-latest + artifact_name: rust-animation-examples-linux + build_deps: sudo apt-get update && sudo apt-get install -y cmake libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libx11-dev libxext-dev + - os: windows-latest + artifact_name: rust-animation-examples-windows + build_deps: "" + - os: macos-latest + artifact_name: rust-animation-examples-macos + build_deps: "" + + steps: + - uses: actions/checkout@v3 + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + + - name: Install dependencies + if: matrix.build_deps != '' + run: ${{ matrix.build_deps }} + + - name: Build examples + run: cargo build --examples --release + + - name: Package examples (Unix) + if: runner.os != 'Windows' + run: | + mkdir -p artifacts + cp target/release/examples/* artifacts/ 2>/dev/null || true + cd artifacts + tar -czf ../${{ matrix.artifact_name }}.tar.gz * || true + + - name: Package examples (Windows) + if: runner.os == 'Windows' + run: | + mkdir artifacts + Copy-Item target\release\examples\*.exe artifacts\ -ErrorAction SilentlyContinue + Compress-Archive -Path artifacts\* -DestinationPath ${{ matrix.artifact_name }}.zip + + - name: Upload Release Asset (Unix) + if: runner.os != 'Windows' + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.create-release.outputs.upload_url }} + asset_path: ./${{ matrix.artifact_name }}.tar.gz + asset_name: ${{ matrix.artifact_name }}.tar.gz + asset_content_type: application/gzip + continue-on-error: true + + - name: Upload Release Asset (Windows) + if: runner.os == 'Windows' + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.create-release.outputs.upload_url }} + asset_path: ./${{ matrix.artifact_name }}.zip + asset_name: ${{ matrix.artifact_name }}.zip + asset_content_type: application/zip + continue-on-error: true diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..3c6013b --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,35 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +### Added +- Automated GitHub release process with workflow_dispatch trigger +- CHANGELOG.md for tracking release notes + +## [0.2.8] - 2024-XX-XX + +### Changed +- Migrated from OpenGL to wgpu 22.1.0 for rendering +- Updated all examples to use winit 0.29.15 with wgpu +- Breaking API changes: set_text now requires wgpu device and queue parameters + +### Added +- CoreAnimation-style API for better iOS/macOS developer familiarity +- WGSL shaders for wgpu backend +- Comprehensive migration guide in MIGRATION.md + +### Fixed +- Improved macOS compatibility with explicit wgpu backend configuration +- Removed all unsafe code blocks for safer API + +### Removed +- OpenGL/GLSL rendering backend +- glfw dependency in favor of winit + +[Unreleased]: https://github.com/joone/rust-animation/compare/v0.2.8...HEAD +[0.2.8]: https://github.com/joone/rust-animation/releases/tag/v0.2.8 diff --git a/RELEASING.md b/RELEASING.md index e286512..a97cf84 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -1,10 +1,14 @@ # Release Process -This document describes how to publish a new version of `rust-animation` to crates.io. +This document describes how to publish a new version of `rust-animation` to crates.io and create a GitHub release. -## Automated Release Process +## Fully Automated Release Process -The project uses GitHub Actions to automate the publishing process. When you push a git tag, the workflow automatically publishes the crate to crates.io. +The project uses GitHub Actions to fully automate releases, including: +- Creating GitHub Releases with auto-generated release notes +- Publishing to crates.io +- Building and attaching example binaries for multiple platforms +- Version validation and testing ### Prerequisites @@ -16,43 +20,149 @@ The project uses GitHub Actions to automate the publishing process. When you pus - Name: `CRATES_IO_TOKEN` - Value: Your crates.io API token -### Steps to Release +## Release Methods -1. **Update the version number** in `Cargo.toml`: - ```toml - [package] - version = "0.2.8" # Update this - ``` +### Method 1: Automated via Version Bump Script (Recommended) -2. **Update CHANGELOG** (if you have one): - - Document all changes since the last release - - Include breaking changes, new features, and bug fixes +Use the included `bump-version.sh` script to automate version management: + +1. **Run the version bump script**: + ```bash + # Bump patch version (0.2.8 -> 0.2.9) + ./bump-version.sh patch + + # Bump minor version (0.2.8 -> 0.3.0) + ./bump-version.sh minor + + # Bump major version (0.2.8 -> 1.0.0) + ./bump-version.sh major + + # Set specific version + ./bump-version.sh 0.3.5 + ``` -3. **Commit the version change**: +2. **Update CHANGELOG.md**: + - The script will create a new version section in CHANGELOG.md + - Fill in the actual changes under the new version section: + ```markdown + ## [0.2.9] - 2024-01-15 + + ### Added + - New feature X + + ### Fixed + - Bug Y + ``` + +3. **Commit and push the version bump**: ```bash - git add Cargo.toml - git commit -m "Bump version to 0.2.8" + git add Cargo.toml CHANGELOG.md + git commit -m "Bump version to 0.2.9" git push origin main ``` 4. **Create and push a git tag**: ```bash - git tag v0.2.8 - git push origin v0.2.8 + git tag v0.2.9 + git push origin v0.2.9 ``` + + The release workflow will automatically: + - Create a GitHub Release with release notes from CHANGELOG.md + - Publish to crates.io + - Build example binaries for Linux, macOS, and Windows + - Attach binaries to the release 5. **Monitor the workflow**: - Go to the Actions tab in GitHub - - Watch the "Publish to crates.io" workflow - - The workflow will: - - Verify the version in Cargo.toml matches the tag - - Run tests - - Build the project - - Publish to crates.io - -6. **Verify the release**: + - Watch the "Create Release" workflow + - Check the Releases page once complete + +### Method 2: Manual Trigger via GitHub UI (With Button!) + +You can trigger a release directly from GitHub's UI without creating a tag locally: + +1. **Update the version** in `Cargo.toml` and `CHANGELOG.md`: + ```toml + [package] + version = "0.2.9" # Update this + ``` + + ```bash + git add Cargo.toml CHANGELOG.md + git commit -m "Bump version to 0.2.9" + git push origin main + ``` + +2. **Trigger the workflow from GitHub**: + - Go to the repository on GitHub + - Click on the "Actions" tab + - Select "Create Release" workflow from the left sidebar + - Click "Run workflow" button (⚡ button on the right) + - Fill in the form: + - **version**: Enter the version number (e.g., `0.2.9`) + - **create_tag**: Check this to automatically create and push the tag + - Click "Run workflow" + +3. **Monitor the workflow**: + - The workflow will automatically create the tag, run tests, create the GitHub Release, and publish to crates.io + - Watch the workflow progress in the Actions tab + +### Method 3: Traditional Tag-Based Release + +The traditional approach still works: + +1. **Update version** in `Cargo.toml` and `CHANGELOG.md` +2. **Commit and push**: + ```bash + git add Cargo.toml CHANGELOG.md + git commit -m "Bump version to 0.2.9" + git push origin main + ``` +3. **Create and push tag**: + ```bash + git tag v0.2.9 + git push origin v0.2.9 + ``` +4. **Workflow runs automatically** when tag is pushed + +## What Happens During a Release + +The automated workflow performs these steps: + +1. **Validation**: + - Verifies `Cargo.toml` version matches the tag/input version + - Fails fast if there's a mismatch + +2. **Testing**: + - Runs the full test suite (`cargo test --lib`) + - Only proceeds if all tests pass + +3. **Building**: + - Builds the release version + - Builds example binaries for Linux, macOS, and Windows + +4. **GitHub Release**: + - Extracts release notes from CHANGELOG.md + - Creates a GitHub Release with the notes + - Attaches example binaries as release assets + +5. **crates.io Publishing**: + - Publishes the crate to crates.io using the `CRATES_IO_TOKEN` + +6. **Verification**: - Check https://crates.io/crates/rust-animation - - Verify the new version appears + - Check https://github.com/joone/rust-animation/releases + - Verify the new version appears in both places + +## Version Numbering + +This project follows [Semantic Versioning](https://semver.org/): +- **MAJOR** version for incompatible API changes +- **MINOR** version for backwards-compatible functionality additions +- **PATCH** version for backwards-compatible bug fixes + +Example: `0.2.8` → `0.2.9` (patch), `0.3.0` (minor), `1.0.0` (major) ## Troubleshooting @@ -62,6 +172,12 @@ If you get a version mismatch error, make sure: - The version in `Cargo.toml` matches the git tag (without the 'v' prefix) - Example: `Cargo.toml` has `version = "0.2.8"` and tag is `v0.2.8` +To fix: +1. Update `Cargo.toml` to match the desired version +2. Commit and push the change +3. Delete the incorrect tag: `git tag -d v0.2.8 && git push origin :refs/tags/v0.2.8` +4. Recreate the tag with the correct version + ### Publishing Fails If publishing fails: @@ -69,10 +185,21 @@ If publishing fails: - Verify the token has publish permissions - Check the workflow logs for specific error messages - Ensure all tests pass: `cargo test --lib` +- Make sure you haven't already published this version + +### GitHub Release Creation Fails + +If GitHub Release creation fails but crates.io publish succeeds: +- The package is already published to crates.io (cannot be unpublished) +- You can manually create a GitHub Release: + 1. Go to https://github.com/joone/rust-animation/releases/new + 2. Select the tag + 3. Copy release notes from CHANGELOG.md + 4. Publish the release ### Manual Publishing (Fallback) -If automated publishing fails, you can publish manually: +If automated publishing fails completely, you can publish manually: ```bash # Make sure you're on the tagged commit @@ -88,11 +215,13 @@ cargo build --release cargo publish ``` -## Version Numbering +Then manually create a GitHub Release as described above. -This project follows [Semantic Versioning](https://semver.org/): -- MAJOR version for incompatible API changes -- MINOR version for backwards-compatible functionality additions -- PATCH version for backwards-compatible bug fixes +## Best Practices -Example: `0.2.8` → `0.2.9` (patch), `0.3.0` (minor), `1.0.0` (major) +1. **Always update CHANGELOG.md** before releasing +2. **Test locally** before pushing tags: `cargo test --lib && cargo build --release` +3. **Use the version bump script** to avoid manual errors +4. **Never force-push tags** - if you need to fix a tag, delete and recreate it +5. **Check the Actions tab** after pushing to ensure the workflow succeeds +6. **Verify both releases** - check both crates.io and GitHub Releases after publishing diff --git a/bump-version.sh b/bump-version.sh new file mode 100755 index 0000000..d7eb615 --- /dev/null +++ b/bump-version.sh @@ -0,0 +1,134 @@ +#!/bin/bash +# Version bump script for rust-animation +# Usage: ./bump-version.sh [major|minor|patch|VERSION] +# Examples: +# ./bump-version.sh patch # 0.2.8 -> 0.2.9 +# ./bump-version.sh minor # 0.2.8 -> 0.3.0 +# ./bump-version.sh major # 0.2.8 -> 1.0.0 +# ./bump-version.sh 0.3.5 # Set to specific version + +set -e + +# Colors for output +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +NC='\033[0m' # No Color + +# Check if Cargo.toml exists +if [ ! -f "Cargo.toml" ]; then + echo -e "${RED}Error: Cargo.toml not found in current directory${NC}" + exit 1 +fi + +# Get current version from Cargo.toml +CURRENT_VERSION=$(grep '^version = ' Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/') +echo -e "${YELLOW}Current version: $CURRENT_VERSION${NC}" + +# Parse version components +IFS='.' read -r -a VERSION_PARTS <<< "$CURRENT_VERSION" +MAJOR="${VERSION_PARTS[0]}" +MINOR="${VERSION_PARTS[1]}" +PATCH="${VERSION_PARTS[2]}" + +# Determine new version based on argument +if [ $# -eq 0 ]; then + echo "Usage: $0 [major|minor|patch|VERSION]" + echo "" + echo "Examples:" + echo " $0 patch # $CURRENT_VERSION -> $MAJOR.$MINOR.$((PATCH + 1))" + echo " $0 minor # $CURRENT_VERSION -> $MAJOR.$((MINOR + 1)).0" + echo " $0 major # $CURRENT_VERSION -> $((MAJOR + 1)).0.0" + echo " $0 0.3.5 # $CURRENT_VERSION -> 0.3.5" + exit 1 +fi + +case "$1" in + major) + NEW_VERSION="$((MAJOR + 1)).0.0" + ;; + minor) + NEW_VERSION="$MAJOR.$((MINOR + 1)).0" + ;; + patch) + NEW_VERSION="$MAJOR.$MINOR.$((PATCH + 1))" + ;; + *) + # Assume it's a specific version number + if [[ ! "$1" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo -e "${RED}Error: Invalid version format. Use X.Y.Z format${NC}" + exit 1 + fi + NEW_VERSION="$1" + ;; +esac + +echo -e "${GREEN}New version: $NEW_VERSION${NC}" + +# Confirm with user +read -p "Update version from $CURRENT_VERSION to $NEW_VERSION? (y/N) " -n 1 -r +echo +if [[ ! $REPLY =~ ^[Yy]$ ]]; then + echo "Aborted." + exit 0 +fi + +# Update Cargo.toml +sed -i.bak "s/^version = \"$CURRENT_VERSION\"/version = \"$NEW_VERSION\"/" Cargo.toml +rm Cargo.toml.bak + +echo -e "${GREEN}✓ Updated Cargo.toml${NC}" + +# Update CHANGELOG.md if it exists +if [ -f "CHANGELOG.md" ]; then + TODAY=$(date +%Y-%m-%d) + + # Check if there's an [Unreleased] section + if grep -q "## \[Unreleased\]" CHANGELOG.md; then + # Add new version section after Unreleased + sed -i.bak "/## \[Unreleased\]/a\\ +\\ +## [$NEW_VERSION] - $TODAY" CHANGELOG.md + + # Update comparison links at the bottom + if grep -q "\[Unreleased\]:" CHANGELOG.md; then + # Update Unreleased link + sed -i.bak "s|\[Unreleased\]:.*|\[Unreleased\]: https://github.com/joone/rust-animation/compare/v$NEW_VERSION...HEAD|" CHANGELOG.md + + # Add new version link if it doesn't exist + if ! grep -q "\[$NEW_VERSION\]:" CHANGELOG.md; then + sed -i.bak "/\[Unreleased\]:/a\\ +[$NEW_VERSION]: https://github.com/joone/rust-animation/releases/tag/v$NEW_VERSION" CHANGELOG.md + fi + fi + + rm CHANGELOG.md.bak + echo -e "${GREEN}✓ Updated CHANGELOG.md${NC}" + echo -e "${YELLOW}Note: Please update the CHANGELOG.md [Unreleased] section with changes for v$NEW_VERSION${NC}" + else + echo -e "${YELLOW}Warning: No [Unreleased] section found in CHANGELOG.md${NC}" + echo -e "${YELLOW}Please manually update CHANGELOG.md with release notes${NC}" + fi +fi + +# Show what changed +echo "" +echo -e "${GREEN}Changes made:${NC}" +echo " Cargo.toml: version = \"$NEW_VERSION\"" +if [ -f "CHANGELOG.md" ]; then + echo " CHANGELOG.md: Added section for [$NEW_VERSION]" +fi + +echo "" +echo -e "${YELLOW}Next steps:${NC}" +echo " 1. Review and update CHANGELOG.md with changes for this release" +echo " 2. Commit the changes:" +echo " git add Cargo.toml CHANGELOG.md" +echo " git commit -m \"Bump version to $NEW_VERSION\"" +echo " git push origin main" +echo " 3. Create a release:" +echo " Option A - Create tag locally:" +echo " git tag v$NEW_VERSION" +echo " git push origin v$NEW_VERSION" +echo " Option B - Use GitHub Actions (go to Actions → Create Release → Run workflow)" +echo "" From c6b0f39cb7e16c96de7d096bd1ae951377c17ad5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 7 Feb 2026 18:23:36 +0000 Subject: [PATCH 3/6] Update release workflow to use modern GitHub Actions and add quick start guide Co-authored-by: joone <1979160+joone@users.noreply.github.com> --- .github/workflows/release.yml | 64 ++++++++---------- RELEASE_QUICKSTART.md | 120 ++++++++++++++++++++++++++++++++++ 2 files changed, 147 insertions(+), 37 deletions(-) create mode 100644 RELEASE_QUICKSTART.md diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bbb0667..099c2a6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,7 +27,7 @@ jobs: outputs: version: ${{ steps.get_version.outputs.version }} - upload_url: ${{ steps.create_release.outputs.upload_url }} + tag_name: ${{ steps.get_version.outputs.TAG_NAME }} steps: - uses: actions/checkout@v3 @@ -95,37 +95,40 @@ jobs: if [ -z "$NOTES" ]; then echo "No specific changelog entry found for version $VERSION" - NOTES="Release version $VERSION - -See [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/main/CHANGELOG.md) for details." + cat > release_notes.txt << ENDOFNOTES + Release version $VERSION + + See [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/main/CHANGELOG.md) for details. + ENDOFNOTES + else + echo "$NOTES" > release_notes.txt fi else # Generate basic release notes from recent commits - NOTES="Release version $VERSION - -## Changes in this release - -$(git log --pretty=format:"- %s" $(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || git rev-list --max-parents=0 HEAD)..HEAD 2>/dev/null || git log --pretty=format:"- %s" -10) - ---- -*See full changelog at [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/main/CHANGELOG.md)*" + echo "Release version $VERSION" > release_notes.txt + echo "" >> release_notes.txt + echo "## Changes in this release" >> release_notes.txt + echo "" >> release_notes.txt + git log --pretty=format:"- %s" $(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || git rev-list --max-parents=0 HEAD)..HEAD 2>/dev/null >> release_notes.txt || git log --pretty=format:"- %s" -10 >> release_notes.txt + echo "" >> release_notes.txt + echo "---" >> release_notes.txt + echo "*See full changelog at [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/main/CHANGELOG.md)*" >> release_notes.txt fi - # Save to file for multiline output - echo "$NOTES" > release_notes.txt echo "Generated release notes" - name: Create GitHub Release id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: softprops/action-gh-release@v1 with: tag_name: ${{ steps.get_version.outputs.TAG_NAME }} - release_name: Release ${{ steps.get_version.outputs.TAG_NAME }} + name: Release ${{ steps.get_version.outputs.TAG_NAME }} body_path: release_notes.txt draft: false prerelease: false + generate_release_notes: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Publish to crates.io env: @@ -179,26 +182,13 @@ $(git log --pretty=format:"- %s" $(git describe --tags --abbrev=0 HEAD^ 2>/dev/n Copy-Item target\release\examples\*.exe artifacts\ -ErrorAction SilentlyContinue Compress-Archive -Path artifacts\* -DestinationPath ${{ matrix.artifact_name }}.zip - - name: Upload Release Asset (Unix) - if: runner.os != 'Windows' - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Upload Release Assets + uses: softprops/action-gh-release@v1 with: - upload_url: ${{ needs.create-release.outputs.upload_url }} - asset_path: ./${{ matrix.artifact_name }}.tar.gz - asset_name: ${{ matrix.artifact_name }}.tar.gz - asset_content_type: application/gzip - continue-on-error: true - - - name: Upload Release Asset (Windows) - if: runner.os == 'Windows' - uses: actions/upload-release-asset@v1 + tag_name: ${{ needs.create-release.outputs.tag_name }} + files: | + *.tar.gz + *.zip env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.create-release.outputs.upload_url }} - asset_path: ./${{ matrix.artifact_name }}.zip - asset_name: ${{ matrix.artifact_name }}.zip - asset_content_type: application/zip continue-on-error: true diff --git a/RELEASE_QUICKSTART.md b/RELEASE_QUICKSTART.md new file mode 100644 index 0000000..8d900fe --- /dev/null +++ b/RELEASE_QUICKSTART.md @@ -0,0 +1,120 @@ +# Automated Release Process - Quick Start Guide + +This repository now has a **fully automated GitHub release process** with multiple options for triggering releases. + +## 🚀 Three Ways to Release + +### Option 1: Push Button Release (Recommended for Quick Releases) + +**Perfect when:** You've already committed version changes and want to release with one click. + +1. Update `Cargo.toml` version and `CHANGELOG.md` +2. Commit and push to main +3. Go to **Actions** → **Create Release** → **Run workflow** button +4. Enter version (e.g., `0.2.9`) and click "Run workflow" +5. Done! 🎉 + +The workflow will automatically: +- Create the git tag +- Run tests +- Create GitHub Release with changelog +- Publish to crates.io +- Build example binaries for Linux/macOS/Windows + +### Option 2: Use the Version Bump Script (Recommended for Developers) + +**Perfect when:** You want automation to help with version management. + +```bash +# Bump version (patch: 0.2.8 → 0.2.9) +./bump-version.sh patch + +# Update CHANGELOG.md with your changes +# (The script creates a new section for you) + +# Commit and push +git add Cargo.toml CHANGELOG.md +git commit -m "Bump version to 0.2.9" +git push origin main + +# Create and push tag +git tag v0.2.9 +git push origin v0.2.9 +``` + +### Option 3: Traditional Tag-Based (Classic Approach) + +**Perfect when:** You prefer the traditional git workflow. + +```bash +# Update Cargo.toml and CHANGELOG.md manually +# Commit and push +git add Cargo.toml CHANGELOG.md +git commit -m "Bump version to 0.2.9" +git push origin main + +# Create and push tag +git tag v0.2.9 +git push origin v0.2.9 +``` + +## 📋 What You Get + +Every release automatically includes: + +✅ **GitHub Release** with formatted release notes from CHANGELOG.md +✅ **crates.io Publication** for Rust users +✅ **Example Binaries** for Linux, macOS, and Windows +✅ **Automated Testing** before release +✅ **Version Validation** to catch mistakes + +## 📁 Files Added + +- **`.github/workflows/release.yml`** - Main release automation workflow +- **`CHANGELOG.md`** - Track changes between versions +- **`bump-version.sh`** - Helper script for version management +- **`RELEASING.md`** - Comprehensive release documentation + +## 🔧 Setup Required + +Only one setup step is needed: + +1. Ensure `CRATES_IO_TOKEN` secret is configured in repository settings + - Go to Settings → Secrets and variables → Actions + - Should already exist if you've published before + +## 🎯 Next Steps + +**For your next release:** + +1. Choose your preferred method above +2. Update CHANGELOG.md with changes +3. Follow the steps for your chosen method +4. Monitor Actions tab to watch the automation + +**Questions?** + +- See detailed docs: `RELEASING.md` +- Check workflow definition: `.github/workflows/release.yml` +- Run version script help: `./bump-version.sh` + +## 🎨 Example Changelog Entry + +```markdown +## [0.2.9] - 2024-01-15 + +### Added +- New particle effects system +- Improved animation easing functions + +### Fixed +- Memory leak in texture loading +- Crash on window resize + +### Changed +- Updated wgpu to version 23.0.0 +``` + +--- + +**Happy Releasing! 🚀** From e304e7b1920c34b4c554645451725457aa7715bd Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 7 Feb 2026 18:30:00 +0000 Subject: [PATCH 4/6] Initial plan From 5131eebe9c85e6b3aec68215dd5b951218e02fce Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 7 Feb 2026 18:35:02 +0000 Subject: [PATCH 5/6] Fix decoding error by using format auto-detection Co-authored-by: joone <1979160+joone@users.noreply.github.com> --- src/layer.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/layer.rs b/src/layer.rs index 6970bde..dcd406d 100644 --- a/src/layer.rs +++ b/src/layer.rs @@ -273,7 +273,13 @@ impl Layer { /// Load image with wgpu context pub fn load_image_texture(&mut self, device: &wgpu::Device, queue: &wgpu::Queue) { if !self.image_path.is_empty() { - match image::open(&Path::new(&self.image_path)) { + // Use format auto-detection to handle images with incorrect extensions + let result = image::ImageReader::open(&Path::new(&self.image_path)) + .and_then(|reader| reader.with_guessed_format()) + .map_err(|e| image::ImageError::IoError(e)) + .and_then(|reader| reader.decode()); + + match result { Ok(img) => { let rgba = img.to_rgba8(); let dimensions = rgba.dimensions(); From d4c83be10a0199fa3f4deab2ad9239660164dfae Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 7 Feb 2026 18:36:12 +0000 Subject: [PATCH 6/6] Improve error handling in image loading code Co-authored-by: joone <1979160+joone@users.noreply.github.com> --- src/layer.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/layer.rs b/src/layer.rs index dcd406d..a5f1367 100644 --- a/src/layer.rs +++ b/src/layer.rs @@ -274,12 +274,12 @@ impl Layer { pub fn load_image_texture(&mut self, device: &wgpu::Device, queue: &wgpu::Queue) { if !self.image_path.is_empty() { // Use format auto-detection to handle images with incorrect extensions - let result = image::ImageReader::open(&Path::new(&self.image_path)) + let img_result = image::ImageReader::open(&Path::new(&self.image_path)) .and_then(|reader| reader.with_guessed_format()) - .map_err(|e| image::ImageError::IoError(e)) + .map_err(image::ImageError::IoError) .and_then(|reader| reader.decode()); - match result { + match img_result { Ok(img) => { let rgba = img.to_rgba8(); let dimensions = rgba.dimensions();