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
136 changes: 136 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
name: Build Desktop App

on:
push:
branches: [trunk]
tags:
- 'v*.*.*'

# Prevent concurrent builds on the same ref
concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true

# Principle of least privilege
permissions:
contents: read

jobs:
build:
timeout-minutes: 30
permissions:
contents: read

strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
target: x86_64-apple-darwin
artifact_name: Aella-macOS.app.tar.gz
- os: windows-latest
target: x86_64-pc-windows-msvc
artifact_name: Aella-Windows.msi

runs-on: ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v4

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

- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.target }}-release

- name: Install cargo-bundle
run: cargo install cargo-bundle --locked --version 0.6.0

- name: Build bundle
run: cargo bundle -p aella-desktop --release

- name: Package macOS app
if: matrix.os == 'macos-latest'
run: |
cd target/release/bundle/osx
tar -czf ../../../../${{ matrix.artifact_name }} Aella.app

- name: Find Windows MSI
if: matrix.os == 'windows-latest'
shell: bash
run: |
MSI_PATH=$(find target/release/bundle/msi -name "*.msi" -type f | head -n 1)
test -n "$MSI_PATH" || { echo "Error: MSI not found"; exit 1; }
echo "MSI_PATH=$MSI_PATH" >> $GITHUB_ENV
cp "$MSI_PATH" "${{ matrix.artifact_name }}"

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: ${{ matrix.artifact_name }}
retention-days: 30

release:
if: startsWith(github.ref, 'refs/tags/')
needs: build
runs-on: ubuntu-latest
timeout-minutes: 15

permissions:
contents: write

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

- name: Install git-cliff
run: |
VERSION="2.7.0"
ARCH=$(uname -m)
TARBALL="git-cliff-${VERSION}-${ARCH}-unknown-linux-gnu.tar.gz"
curl -fL --retry 3 --retry-delay 2 \
"https://github.com/orhun/git-cliff/releases/download/v${VERSION}/${TARBALL}" \
-o "${TARBALL}"
tar xzf "${TARBALL}"
sudo mv git-cliff-*/git-cliff /usr/local/bin/
chmod +x /usr/local/bin/git-cliff

- name: Generate release notes
run: git-cliff --strip all --latest > release-notes.md

- name: Download macOS artifact
uses: actions/download-artifact@v4
with:
name: Aella-macOS.app.tar.gz

- name: Download Windows artifact
uses: actions/download-artifact@v4
with:
name: Aella-Windows.msi

- name: Generate checksums
run: |
sha256sum Aella-macOS.app.tar.gz > Aella-macOS.app.tar.gz.sha256
sha256sum Aella-Windows.msi > Aella-Windows.msi.sha256

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: |
Aella-macOS.app.tar.gz
Aella-macOS.app.tar.gz.sha256
Aella-Windows.msi
Aella-Windows.msi.sha256
body_path: release-notes.md
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41 changes: 41 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Test

on:
push:
branches: [trunk]
pull_request:

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

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

- name: Cache cargo registry
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}

- name: Cache cargo index
uses: actions/cache@v4
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}

- name: Cache cargo build
uses: actions/cache@v4
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}

- name: Test aella-cli
run: cargo test -p aella-cli

- name: Test aella-desktop
run: cargo test -p aella-desktop
2 changes: 0 additions & 2 deletions aella-desktop/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ image = "0.25.9"
name = "Aella"
identifier = "com.arkye03.aella"
icon = [
"aella-desktop/assets/aella.icns",
"aella-desktop/assets/aellaWindowsIcon.ico",
"assets/aella.icns",
"assets/aellaWindowsIcon.ico",
]
Expand Down
94 changes: 94 additions & 0 deletions cliff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# git-cliff ~ configuration file
# https://git-cliff.org/docs/configuration


[changelog]
# A Tera template to be rendered for each release in the changelog.
# See https://keats.github.io/tera/docs/#introduction
body = """
{% if version %}\
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
{% else %}\
## [unreleased]
{% endif %}\
{% for group, commits in commits | group_by(attribute="group") %}
### {{ group | striptags | trim | upper_first }}
{% for commit in commits %}
- {% if commit.scope %}*({{ commit.scope }})* {% endif %}\
{% if commit.breaking %}[**breaking**] {% endif %}\
{{ commit.message | upper_first }}\
{% endfor %}
{% endfor %}
"""
# Remove leading and trailing whitespaces from the changelog's body.
trim = true
# Render body even when there are no releases to process.
render_always = true
# An array of regex based postprocessors to modify the changelog.
postprocessors = [
# Replace the placeholder <REPO> with a URL.
#{ pattern = '<REPO>', replace = "https://github.com/orhun/git-cliff" },
]
# render body even when there are no releases to process
# render_always = true
# output file path
# output = "test.md"

[git]
# Parse commits according to the conventional commits specification.
# See https://www.conventionalcommits.org
conventional_commits = true
# Exclude commits that do not match the conventional commits specification.
filter_unconventional = true
# Require all commits to be conventional.
# Takes precedence over filter_unconventional.
require_conventional = false
# Split commits on newlines, treating each line as an individual commit.
split_commits = false
# An array of regex based parsers to modify commit messages prior to further processing.
commit_preprocessors = [
# Replace issue numbers with link templates to be updated in `changelog.postprocessors`.
#{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/issues/${2}))"},
# Check spelling of the commit message using https://github.com/crate-ci/typos.
# If the spelling is incorrect, it will be fixed automatically.
#{ pattern = '.*', replace_command = 'typos --write-changes -' },
]
# Prevent commits that are breaking from being excluded by commit parsers.
protect_breaking_commits = false
# An array of regex based parsers for extracting data from the commit message.
# Assigns commits to groups.
# Optionally sets the commit's scope and can decide to exclude commits from further processing.
commit_parsers = [
{ message = "^feat", group = "<!-- 0 -->🚀 Features" },
{ message = "^fix", group = "<!-- 1 -->🐛 Bug Fixes" },
{ message = "^doc", group = "<!-- 3 -->📚 Documentation" },
{ message = "^perf", group = "<!-- 4 -->⚡ Performance" },
{ message = "^refactor", group = "<!-- 2 -->🚜 Refactor" },
{ message = "^style", group = "<!-- 5 -->🎨 Styling" },
{ message = "^test", group = "<!-- 6 -->🧪 Testing" },
{ message = "^chore\\(release\\): prepare for", skip = true },
{ message = "^chore\\(deps.*\\)", skip = true },
{ message = "^chore\\(pr\\)", skip = true },
{ message = "^chore\\(pull\\)", skip = true },
{ message = "^chore|^ci", group = "<!-- 7 -->⚙️ Miscellaneous Tasks" },
{ body = ".*security", group = "<!-- 8 -->🛡️ Security" },
{ message = "^revert", group = "<!-- 9 -->◀️ Revert" },
{ message = ".*", group = "<!-- 10 -->💼 Other" },
]
# Exclude commits that are not matched by any commit parser.
filter_commits = false
# Fail on a commit that is not matched by any commit parser.
fail_on_unmatched_commit = false
# An array of link parsers for extracting external references, and turning them into URLs, using regex.
link_parsers = []
# Include only the tags that belong to the current branch.
use_branch_tags = false
# Order releases topologically instead of chronologically.
topo_order = false
# Order commits topologically instead of chronologically.
topo_order_commits = true
# Order of commits in each group/release within the changelog.
# Allowed values: newest, oldest
sort_commits = "oldest"
# Process submodules commits
recurse_submodules = false
58 changes: 58 additions & 0 deletions scripts/generateRelease.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/bin/bash
set -e

# Check if git-cliff is installed
if ! command -v git-cliff &> /dev/null; then
echo "Error: git-cliff is not installed"
echo "Install it with: cargo install git-cliff"
exit 1
fi

# Check if we're on trunk branch
CURRENT_BRANCH=$(git branch --show-current)
if [ "$CURRENT_BRANCH" != "trunk" ]; then
echo "Error: You must be on the trunk branch to create a release"
echo "Current branch: $CURRENT_BRANCH"
exit 1
fi

# Check if working directory is clean
if ! git diff-index --quiet HEAD --; then
echo "Error: Working directory is not clean"
echo "Please commit or stash your changes before creating a release"
exit 1
fi

# Get the next version from git-cliff
echo "Calculating next version..."
VERSION=$(git-cliff --bumped-version)

if [ -z "$VERSION" ]; then
echo "Error: Could not determine next version"
exit 1
fi

echo "Next version: $VERSION"

# Update the changelog
echo "Updating CHANGELOG.md..."
git-cliff --tag "$VERSION" -o CHANGELOG.md

# Stage the changelog
git add CHANGELOG.md

# Commit the changelog if there are changes
if ! git diff-index --quiet HEAD --; then
git commit -m "chore(release): prepare for $VERSION"
fi

# Create a signed tag
echo "Creating signed tag v$VERSION..."
git tag -s "v$VERSION" -m "Release v$VERSION"

echo ""
echo "Release v$VERSION created successfully!"
echo ""
echo "To push the release, run:"
echo " git push origin trunk"
echo " git push origin v$VERSION"