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
43 changes: 42 additions & 1 deletion .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,58 @@ permissions:

jobs:
auto-release:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4

- name: Setup Ubuntu dependencies
uses: ./.github/actions/setup-ubuntu-deps

- name: Build cabin
run: make BUILD=release -j4
env:
CXX: g++-14

- name: Install nFPM
run: |
echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | sudo tee /etc/apt/sources.list.d/goreleaser.list
sudo apt-get update
sudo apt-get install -y nfpm

- name: Create DEB package
run: nfpm pkg --packager deb
env:
CABIN_VERSION: ${{ github.ref_name }}

- name: Create RPM package
run: nfpm pkg --packager rpm
env:
CABIN_VERSION: ${{ github.ref_name }}

- name: Release
uses: softprops/action-gh-release@v2
with:
draft: false
generate_release_notes: true
files: |
*.deb
*.rpm
body: |
:sparkling_heart: I maintain **Cabin** in my spare time. Buy me a coffee on [GitHub Sponsors](https://github.com/sponsors/ken-matsui) so I can keep shipping features!

## Installation

### Ubuntu/Debian
```bash
wget https://github.com/cabinpkg/cabin/releases/download/${{ github.ref_name }}/cabin_${{ github.ref_name }}_amd64.deb
sudo dpkg -i cabin_${{ github.ref_name }}_amd64.deb
```

### RHEL/CentOS/Fedora
```bash
wget https://github.com/cabinpkg/cabin/releases/download/${{ github.ref_name }}/cabin-${{ github.ref_name }}-1.x86_64.rpm
sudo rpm -i cabin-${{ github.ref_name }}-1.x86_64.rpm
```

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49 changes: 49 additions & 0 deletions .github/workflows/cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,55 @@ jobs:
--output-file coverage.info
lcov --list coverage.info

package-test:
needs: build-and-test
runs-on: ubuntu-24.04
env:
CXX: g++-14
steps:
- uses: actions/checkout@v4

- name: Setup Ubuntu dependencies
uses: ./.github/actions/setup-ubuntu-deps

- name: Build cabin
run: make BUILD=release -j4

- name: Install nFPM
run: |
echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | sudo tee /etc/apt/sources.list.d/goreleaser.list
sudo apt-get update
sudo apt-get install -y nfpm

- name: Test DEB package creation
run: nfpm pkg --packager deb
env:
CABIN_VERSION: ${{ github.sha }}

- name: Test RPM package creation
run: nfpm pkg --packager rpm
env:
CABIN_VERSION: ${{ github.sha }}

- name: List created packages
run: ls -la ./*.deb ./*.rpm

- name: Verify package contents
run: |
dpkg-deb --contents ./*.deb | grep '/usr/bin/cabin'
rpm -qlp ./*.rpm | grep '/usr/bin/cabin'

- name: Test DEB package installation
run: sudo dpkg -i ./*.deb

- name: Create test project
run: cabin new test_pj
working-directory: ${{ runner.temp }}

- name: Test cabin functionality
run: cabin run | grep 'Hello, world!'
working-directory: ${{ runner.temp }}/test_pj

format:
needs: build-and-test
runs-on: ubuntu-24.04
Expand Down
26 changes: 26 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,32 @@ Make sure to add new tests for any new functionality you introduce. See
<https://github.com/felipec/sharness/blob/v1.2.1/API.md> for more information on
how to use `sharness`.

### Packaging

To test the Linux package creation locally, you can use nFPM:

```bash
# Install nFPM (if not already installed)
brew install nfpm # macOS
# or follow instructions at https://nfpm.goreleaser.com/install/

# Build cabin first
make BUILD=release -j$(nproc)

# Create DEB package
CABIN_VERSION="1.0.0" nfpm pkg --packager deb

# Create RPM package
CABIN_VERSION="1.0.0" nfpm pkg --packager rpm

# Verify packages were created
ls -la *.deb *.rpm
```

The packaging configuration is defined in `nfpm.yaml`. Both DEB and RPM
packages are automatically created and published on GitHub releases when tags
are pushed.

## Documentation

If your changes affect the project's documentation, ensure you update the
Expand Down
44 changes: 44 additions & 0 deletions nfpm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: cabin
arch: amd64
platform: linux
version: "${CABIN_VERSION}"
section: utils
priority: extra
maintainer: "Ken Matsui <26405363+ken-matsui@users.noreply.github.com>"
description: |
C++ package manager and build system.

Cabin is a modern C++ package manager and build system that makes it easy
to build and manage C++ projects with external dependencies.
vendor: "Cabin"
homepage: "https://cabinpkg.com"
license: "Apache-2.0"

depends:
- "libstdc++6"

contents:
- src: ./build/cabin
dst: /usr/bin/cabin
file_info:
mode: 0755

overrides:
deb:
depends:
- "libstdc++6"
- "libfmt9 | libfmt-dev"
- "libspdlog1.10 | libspdlog-dev"
- "libcurl4"
- "libgit2-1.7 | libgit2-dev"
- "nlohmann-json3-dev | libnlohmann-json-dev"
- "libtbb12 | libtbb-dev"
rpm:
depends:
- "libstdc++"
- "fmt-devel"
- "spdlog-devel"
- "libcurl-devel"
- "libgit2-devel"
- "json-devel"
- "tbb-devel"
Loading