Merge pull request #266 from egohygiene/copilot/add-pareto-frontier-p… #394
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: | |
| - '**' | |
| tags: | |
| - 'v*' | |
| pull_request: | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: "1.94" | |
| components: clippy | |
| - name: Lint (clippy) | |
| run: cargo clippy -- -D warnings | |
| - name: Build | |
| run: cargo build --verbose | |
| - name: Test | |
| run: cargo test --verbose | |
| generate-changelog: | |
| name: Generate Changelog | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| concurrency: | |
| group: changelog-${{ github.repository }} | |
| cancel-in-progress: false | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository (main branch) | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.repository.default_branch }} | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| fetch-depth: 0 | |
| - name: Fetch tags | |
| run: git fetch --tags | |
| - name: Install git-cliff | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: git-cliff | |
| - name: Generate full changelog | |
| run: git cliff -o CHANGELOG.md | |
| - name: Generate release notes | |
| run: git cliff --latest --strip header -o RELEASE_NOTES.md | |
| - name: Commit changelog | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add CHANGELOG.md | |
| if git diff --staged --quiet; then | |
| echo "Changelog already up to date, no commit needed." | |
| else | |
| git commit -m "chore(release): update changelog" | |
| git push origin ${{ github.event.repository.default_branch }} | |
| fi | |
| - name: Upload release notes artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: release-notes | |
| path: RELEASE_NOTES.md | |
| - name: Create GitHub Release with changelog | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| body_path: RELEASE_NOTES.md | |
| release-binaries: | |
| name: Release binary (${{ matrix.target }}) | |
| runs-on: ${{ matrix.runner }} | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| needs: generate-changelog | |
| permissions: | |
| contents: write | |
| strategy: | |
| matrix: | |
| include: | |
| - target: x86_64-unknown-linux-musl | |
| artifact_name: renderflow-x86_64-unknown-linux-musl | |
| binary: target/x86_64-unknown-linux-musl/release/renderflow | |
| runner: ubuntu-latest | |
| use_cross: true | |
| - target: aarch64-unknown-linux-musl | |
| artifact_name: renderflow-aarch64-unknown-linux-musl | |
| binary: target/aarch64-unknown-linux-musl/release/renderflow | |
| runner: ubuntu-latest | |
| use_cross: true | |
| - target: x86_64-unknown-linux-gnu | |
| artifact_name: renderflow-x86_64-unknown-linux-gnu | |
| binary: target/x86_64-unknown-linux-gnu/release/renderflow | |
| runner: ubuntu-latest | |
| use_cross: true | |
| - target: x86_64-pc-windows-gnu | |
| artifact_name: renderflow-x86_64-pc-windows-gnu.exe | |
| binary: target/x86_64-pc-windows-gnu/release/renderflow.exe | |
| runner: ubuntu-latest | |
| use_cross: true | |
| - target: x86_64-apple-darwin | |
| artifact_name: renderflow-x86_64-apple-darwin | |
| binary: target/x86_64-apple-darwin/release/renderflow | |
| runner: macos-13 | |
| use_cross: false | |
| - target: aarch64-apple-darwin | |
| artifact_name: renderflow-aarch64-apple-darwin | |
| binary: target/aarch64-apple-darwin/release/renderflow | |
| runner: macos-latest | |
| use_cross: false | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: "1.94" | |
| targets: ${{ matrix.target }} | |
| - name: Install cross | |
| if: matrix.use_cross | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: cross | |
| - name: Build release binary (cross) | |
| if: matrix.use_cross | |
| run: cross build --target ${{ matrix.target }} --release | |
| - name: Build release binary (cargo) | |
| if: "!matrix.use_cross" | |
| run: cargo build --target ${{ matrix.target }} --release | |
| - name: Rename binary | |
| shell: bash | |
| run: cp ${{ matrix.binary }} ${{ matrix.artifact_name }} | |
| - name: Generate SHA256 checksum | |
| shell: bash | |
| run: | | |
| if command -v sha256sum &>/dev/null; then | |
| sha256sum "${{ matrix.artifact_name }}" > "${{ matrix.artifact_name }}.sha256" | |
| else | |
| shasum -a 256 "${{ matrix.artifact_name }}" > "${{ matrix.artifact_name }}.sha256" | |
| fi | |
| - name: Upload release artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.artifact_name }} | |
| path: | | |
| ${{ matrix.artifact_name }} | |
| ${{ matrix.artifact_name }}.sha256 | |
| - name: Upload binary to GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| ${{ matrix.artifact_name }} | |
| ${{ matrix.artifact_name }}.sha256 | |
| package-deb: | |
| name: Package .deb (x86_64) | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| needs: generate-changelog | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: "1.94" | |
| - name: Install cargo-deb | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: cargo-deb | |
| - name: Build release binary | |
| run: cargo build --release | |
| - name: Build .deb package | |
| run: cargo deb --no-build | |
| - name: Upload .deb artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: renderflow-deb-x86_64 | |
| path: target/debian/*.deb | |
| - name: Upload .deb to GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: target/debian/*.deb | |
| package-rpm: | |
| name: Package .rpm (x86_64) | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| needs: generate-changelog | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: "1.94" | |
| - name: Install cargo-generate-rpm | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: cargo-generate-rpm | |
| - name: Build release binary | |
| run: cargo build --release | |
| - name: Build .rpm package | |
| run: cargo generate-rpm | |
| - name: Upload .rpm artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: renderflow-rpm-x86_64 | |
| path: target/generate-rpm/*.rpm | |
| - name: Upload .rpm to GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: target/generate-rpm/*.rpm | |
| validate-pkgbuild: | |
| name: Validate PKGBUILD (Arch Linux) | |
| runs-on: ubuntu-latest | |
| container: archlinux:latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: pacman -Syu --noconfirm base-devel namcap | |
| - name: Validate PKGBUILD with namcap | |
| run: namcap pkg/aur/renderflow-git/PKGBUILD | |
| update-homebrew-formula: | |
| name: Update Homebrew formula | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository (main branch) | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.repository.default_branch }} | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Compute source tarball SHA256 | |
| id: formula | |
| run: | | |
| VERSION="${{ github.ref_name }}" | |
| URL="https://github.com/egohygiene/renderflow/archive/refs/tags/${VERSION}.tar.gz" | |
| SHA256=$(curl -fsSL "$URL" | sha256sum | awk '{print $1}') | |
| echo "url=${URL}" >> "$GITHUB_OUTPUT" | |
| echo "sha256=${SHA256}" >> "$GITHUB_OUTPUT" | |
| - name: Update formula url and sha256 | |
| run: | | |
| sed -i 's|url "https://github.com/egohygiene/renderflow/archive/refs/tags/.*"|url "${{ steps.formula.outputs.url }}"|' Formula/renderflow.rb | |
| sed -i 's|sha256 ".*"|sha256 "${{ steps.formula.outputs.sha256 }}"|' Formula/renderflow.rb | |
| - name: Commit and push updated formula | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add Formula/renderflow.rb | |
| if git diff --staged --quiet; then | |
| echo "Formula already up to date, no commit needed." | |
| else | |
| git commit -m "chore: update Homebrew formula to ${{ github.ref_name }}" | |
| git push origin ${{ github.event.repository.default_branch }} | |
| fi | |