wallflow 0.5.2

Elegant wallpaper management with smooth transitions, powered by awww
Documentation
name: Release

on:
  push:
    tags:
      - 'v*'

env:
  CARGO_TERM_COLOR: always

jobs:
  build:
    name: Build ${{ matrix.target }}
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        include:
          - target: x86_64-unknown-linux-gnu
            os: ubuntu-latest
          - target: aarch64-unknown-linux-gnu
            os: ubuntu-latest
          - target: x86_64-apple-darwin
            os: macos-latest
          - target: aarch64-apple-darwin
            os: macos-latest

    steps:
      - uses: actions/checkout@v4

      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable
        with:
          targets: ${{ matrix.target }}

      - name: Install cross-compilation tools (Linux ARM64)
        if: matrix.target == 'aarch64-unknown-linux-gnu'
        run: |
          sudo apt-get update
          sudo apt-get install -y gcc-aarch64-linux-gnu

      - name: Build
        run: |
          if [ "${{ matrix.target }}" = "aarch64-unknown-linux-gnu" ]; then
            export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc
          fi
          cargo build --release --target ${{ matrix.target }}

      - name: Strip binary (Linux/macOS)
        run: |
          cd target/${{ matrix.target }}/release
          if [ "${{ matrix.target }}" = "aarch64-unknown-linux-gnu" ]; then
            aarch64-linux-gnu-strip wallflow || true
          else
            strip wallflow || true
          fi

      - name: Create archive
        run: |
          cd target/${{ matrix.target }}/release
          cp wallflow wallflow-${{ matrix.target }}

      - name: Upload artifact
        uses: actions/upload-artifact@v4
        with:
          name: wallflow-${{ matrix.target }}
          path: target/${{ matrix.target }}/release/wallflow-${{ matrix.target }}

  release:
    name: Create Release
    needs: build
    runs-on: ubuntu-latest
    permissions:
      contents: write

    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Download all artifacts
        uses: actions/download-artifact@v4
        with:
          path: artifacts

      - name: Generate changelog
        id: changelog
        run: |
          # Get previous tag
          PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")

          if [ -n "$PREV_TAG" ]; then
            echo "Changes since $PREV_TAG:" > CHANGELOG.md
            echo "" >> CHANGELOG.md
            git log --pretty=format:"- %s" $PREV_TAG..HEAD >> CHANGELOG.md
          else
            echo "Initial release" > CHANGELOG.md
          fi

          echo "" >> CHANGELOG.md
          echo "" >> CHANGELOG.md
          echo "## Installation" >> CHANGELOG.md
          echo "" >> CHANGELOG.md
          echo "Download the appropriate binary for your platform:" >> CHANGELOG.md
          echo "- **Linux x86_64**: \`wallflow-x86_64-unknown-linux-gnu\`" >> CHANGELOG.md
          echo "- **Linux ARM64**: \`wallflow-aarch64-unknown-linux-gnu\`" >> CHANGELOG.md
          echo "- **macOS Intel**: \`wallflow-x86_64-apple-darwin\`" >> CHANGELOG.md
          echo "- **macOS Apple Silicon**: \`wallflow-aarch64-apple-darwin\`" >> CHANGELOG.md
          echo "" >> CHANGELOG.md
          echo "Then make it executable and move to your PATH:" >> CHANGELOG.md
          echo "\`\`\`bash" >> CHANGELOG.md
          echo "chmod +x wallflow-*" >> CHANGELOG.md
          echo "mv wallflow-* ~/.local/bin/wallflow" >> CHANGELOG.md
          echo "\`\`\`" >> CHANGELOG.md
          echo "" >> CHANGELOG.md
          echo "Or update an existing installation:" >> CHANGELOG.md
          echo "\`\`\`bash" >> CHANGELOG.md
          echo "wallflow update" >> CHANGELOG.md
          echo "\`\`\`" >> CHANGELOG.md

      - name: Create Release
        uses: softprops/action-gh-release@v1
        with:
          body_path: CHANGELOG.md
          files: |
            artifacts/wallflow-x86_64-unknown-linux-gnu/wallflow-x86_64-unknown-linux-gnu
            artifacts/wallflow-aarch64-unknown-linux-gnu/wallflow-aarch64-unknown-linux-gnu
            artifacts/wallflow-x86_64-apple-darwin/wallflow-x86_64-apple-darwin
            artifacts/wallflow-aarch64-apple-darwin/wallflow-aarch64-apple-darwin
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

  publish-crates:
    name: Publish to crates.io
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable

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

  copr-build:
    name: Trigger COPR build
    runs-on: ubuntu-latest
    needs: release
    steps:
      - name: Trigger Fedora COPR build
        run: |
          curl -X POST "https://copr.fedorainfracloud.org/webhooks/custom/209154/b911ecac-f44d-472a-b7e9-fff5a19c59e7/wallflow"