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
85 changes: 85 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Release

on:
push:
branches:
- latest

permissions:
contents: write

jobs:
release:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Validate Scripts
run: |
echo "Validating shell scripts..."
bash -n install.sh
bash -n uninstall.sh
echo "✅ Scripts are valid"

- name: Generate Version
id: version
run: |
# Date-based versioning (Ubuntu-style): vYYYY.MM or vYYYY.MM.patch
BASE_VERSION="v$(date +%Y.%m)"

# Check if this version tag already exists
EXISTING=$(git tag -l "${BASE_VERSION}*" | sort -V | tail -1)

if [ -z "$EXISTING" ]; then
VERSION="$BASE_VERSION"
elif [ "$EXISTING" = "$BASE_VERSION" ]; then
VERSION="${BASE_VERSION}.1"
else
# Extract patch number and increment
PATCH=$(echo "$EXISTING" | sed "s/${BASE_VERSION}\.//")
VERSION="${BASE_VERSION}.$((PATCH + 1))"
fi

echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Generated version: $VERSION"

- name: Generate Release Notes
run: |
# Get the latest release tag
PREV_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")

echo "## What's Changed" > RELEASE_NOTES.md
echo "" >> RELEASE_NOTES.md

if [ -n "$PREV_TAG" ]; then
# Generate changelog from commits since last release
git log --pretty=format:"- %s (%h)" $PREV_TAG..HEAD >> RELEASE_NOTES.md
else
# First release - show recent commits
git log --pretty=format:"- %s (%h)" -20 >> RELEASE_NOTES.md
fi

echo "" >> RELEASE_NOTES.md
echo "" >> RELEASE_NOTES.md
echo "## Installation" >> RELEASE_NOTES.md
echo "" >> RELEASE_NOTES.md
echo '```bash' >> RELEASE_NOTES.md
echo 'curl -fsSL https://raw.githubusercontent.com/draphy/draphyOS/latest/install.sh | bash' >> RELEASE_NOTES.md
echo '```' >> RELEASE_NOTES.md

echo "--- Release Notes ---"
cat RELEASE_NOTES.md

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.version.outputs.version }}
name: ${{ steps.version.outputs.version }}
body_path: RELEASE_NOTES.md
make_latest: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
74 changes: 74 additions & 0 deletions .github/workflows/verify-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Verify PR

on:
pull_request:
types: [opened, synchronize, reopened, edited]

permissions:
contents: read
pull-requests: write

jobs:
pr-title-check:
name: PR Title Check
runs-on: ubuntu-latest
steps:
- name: Check PR Title
shell: bash
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: |
echo "Checking PR title: $PR_TITLE"

# Define valid types (conventional commits)
VALID_TYPES="feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert"

# Simple conventional commit format: type: description
if ! [[ "$PR_TITLE" =~ ^($VALID_TYPES):[[:space:]].+ ]]; then
echo "::error::PR title does not match conventional commit format!"
echo "::error::"
echo "::error::Required format: <type>: <description>"
echo "::error::"
echo "::error::Valid types: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert"
echo "::error::"
echo "::error::Examples:"
echo "::error:: feat: add network speed display to polybar"
echo "::error:: fix: correct battery detection on desktops"
echo "::error:: docs: update installation instructions"
echo "::error:: chore: update package list"
echo "::error::"
echo "::error::Your title: \"$PR_TITLE\""
exit 1
else
echo "✅ PR title format is valid!"
fi

shellcheck:
name: Shell Script Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
with:
scandir: '.'
severity: warning
env:
SHELLCHECK_OPTS: -e SC1091 -e SC2034

label-merge-conflicts:
name: Check Conflicts
runs-on: ubuntu-latest
steps:
- name: Label Merge Conflicts
uses: prince-chrismc/label-merge-conflicts-action@v3
with:
conflict_label_name: "conflicts"
github_token: ${{ secrets.GITHUB_TOKEN }}
conflict_comment: |
Hi @${{ github.actor }},

This PR has merge conflicts with the base branch.
Please rebase or merge the latest changes from `latest`.
213 changes: 213 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,213 @@
# Contributing to draphyOS

Thank you for your interest in contributing to draphyOS! This document provides guidelines and instructions for contributing to this project.

## Code of Conduct

By participating in this project, you agree to be respectful and create a harassment-free experience for everyone.

## Contribution Workflow

We follow a structured workflow for all contributions. Here's the process:

### 1. Create an Issue

- Before making any changes, start by creating an issue in the [GitHub issue tracker](https://github.com/draphy/draphyOS/issues)
- Clearly describe the bug, feature, or improvement you want to address
- Wait for a DRO issue number to be assigned in the comments

> **Note:** Small fixes (typos, minor docs) can skip this step — just open a PR directly.

### 2. Branch Naming Convention

Create a branch with the following naming format:

```
username/dro-<issue-number>-<issue-title>
```

Example:

```
johndoe/dro-123-fix-battery-detection
janedoe/dro-45-add-bluetooth-module
```

### 3. Fork and Clone the Repository

- Fork the repository to your GitHub account
- Clone your fork to your local machine
- Add the upstream repository as a remote

```bash
git clone https://github.com/YOUR_USERNAME/draphyOS.git
cd draphyOS
git remote add upstream https://github.com/draphy/draphyOS.git
```

### 4. Set Up the Development Environment

```bash
# Ensure you have shellcheck installed
sudo dnf install ShellCheck

# Validate scripts
shellcheck install.sh uninstall.sh

# Check bash syntax
bash -n install.sh
bash -n uninstall.sh
```

### 5. Make Your Changes

- Create a new branch with the proper naming convention
- Make your changes following the coding conventions
- Update documentation if necessary

**What you can modify:**
- **Configs**: Edit files in `configs/`
- **Scripts**: Modify `install.sh`, `uninstall.sh`
- **Docs**: Update `README.md`, `CONTRIBUTING.md`

### 6. Commit Guidelines

We use [Conventional Commits](https://www.conventionalcommits.org/) for clear and meaningful commit messages.

Format:

```
<type>: <description>
```

Where `type` is one of:

| Type | Description |
| ---------- | ------------------------------ |
| `feat` | A new feature |
| `fix` | A bug fix |
| `docs` | Documentation changes |
| `style` | Formatting, no code change |
| `refactor` | Code refactoring |
| `perf` | Performance improvements |
| `test` | Adding or updating tests |
| `build` | Build system changes |
| `ci` | CI configuration changes |
| `chore` | Maintenance tasks |
| `revert` | Reverting changes |

Example:

```bash
git commit -m "feat: add network speed display to polybar"
git commit -m "fix: correct battery detection on desktops"
git commit -m "docs: update installation instructions"
```

### 7. Pull Request Process

0. Before pushing, run the full local check to ensure CI will pass:

```bash
# Lint shell scripts
shellcheck install.sh uninstall.sh

# Check bash syntax
bash -n install.sh
bash -n uninstall.sh
```

1. Push your changes to your fork
2. Create a pull request against the `latest` branch
3. Use this format for the PR title:
```
<type>: <Description starting with capital letter>
```
Example:
```
feat: Add network speed display to polybar
fix: Correct battery detection on desktops
docs: Update installation instructions
```
4. Provide a detailed description in the PR
5. Link the PR to the relevant issue
6. Ensure all status checks pass
7. Request a review from maintainers

Pull requests require approval before they can be merged.

**PR Title Examples:**

| ✅ Valid | ❌ Invalid |
| -------------------------------------------- | ----------------------------- |
| `feat: Add network speed display to polybar` | `Added new feature` |
| `fix: Correct battery detection on desktops` | `fix - battery bug` |
| `docs: Update installation instructions` | `updated docs` |

### 8. CI Checks

Your PR will automatically run these checks:

| Check | What It Does |
| ------------------ | -------------------------------------- |
| **PR Title Check** | Validates conventional commit format |
| **ShellCheck** | Lints shell scripts for errors |
| **Conflict Check** | Detects merge conflicts with `latest` |

All checks must pass before merging.

## Development Guidelines

### Code Style

**Shell Scripts:**
- Run `shellcheck` before committing
- Quote variables: `"$variable"` not `$variable`
- Use `[[ ]]` for conditionals (not `[ ]`)
- Add comments for complex logic
- Follow [Google Shell Style Guide](https://google.github.io/styleguide/shellguide.html)

**Config Files:**
- Keep configs well-commented
- Use consistent indentation
- Document hardware-specific settings

### Testing

For full testing, run the installer on a Fedora system:

```bash
./install.sh
```

### Documentation

- Update documentation to reflect any changes
- Use clear and concise language
- Follow the existing documentation style

## What to Contribute

**Good First Issues:**
- Fix typos in docs or comments
- Improve error messages in scripts
- Add missing keybindings to cheatsheet
- Better hardware detection

**Feature Ideas:**
- New polybar modules
- Additional rofi themes
- More cheatsheets (vim, tmux, etc.)
- Improved install/uninstall scripts

## Getting Help

If you need help with the contribution process or have questions, feel free to:

- Comment on the relevant issue
- Ask questions in pull requests
- Open a discussion for general questions

---

Thank you for contributing to draphyOS! Your efforts help make this project better for everyone.
Loading