Skip to content

Commit

Permalink
feat: build deb (#64)
Browse files Browse the repository at this point in the history
* chore: testing fpm build

* chore: optmizing tests

* chore: run release on any push

* chore: removing version for tests

* fix: version for tests

* chore: fpm deps sudo install

* fix: removing license for now

* fix: building deb with version as an argument

* fix: binary path

* fix: fpm license

* chore: uploading deb as an artifact

* fix: fpm command

* chore: using make commands for building

* chore: build make commands run in todayiwill folder

* fix: working dir not needed

* fix: redirect being done on make build-doc

* fix: folders in makefile

* fix: make arguments on release build

* fix: version for tests

* fix: returning on tags release

* fix: updating version on release to be the current tag

* fix: release job on release script

* docs: deb packages

* fix: install deb
  • Loading branch information
vncsmyrnk authored Oct 13, 2024
1 parent 0862f5a commit 55c6fef
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 14 deletions.
25 changes: 12 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ jobs:
matrix:
platform: [ubuntu-22.04]

defaults:
run:
working-directory: ./todayiwill

runs-on: ${{ matrix.platform }}
steps:
- name: Checkout
Expand All @@ -27,32 +23,35 @@ jobs:
- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@v1

- name: Set version
- name: Build
run: |
VERSION=${{ github.ref_name }}
sed -i "s/^version =.*/version = \"${VERSION:1}\"/g" Cargo.toml
- name: Build
run: cargo build --release
make VERSION=${VERSION:1} build
- name: Build doc
run: cargo doc --no-deps

- name: Add redirect
run: echo '<meta http-equiv="refresh" content="0;url=todayiwill/index.html">' > target/doc/index.html
run: |
make build-doc
- name: Upload Documentation
uses: actions/upload-artifact@v4
with:
name: documentation
path: ./todayiwill/target/doc

- name: Build deb package
run: |
VERSION=${{ github.ref_name }}
sudo apt-get install ruby-dev build-essential
sudo gem install --no-document fpm
make VERSION=${VERSION:1} build-deb
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: artifacts
path: |
./todayiwill/target/release
./todayiwill_*.deb
./install-*
./uninstall-*
Expand Down
17 changes: 17 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
build:
@sed -i "s/^version =.*/version = \"$(VERSION)\"/g" todayiwill/Cargo.toml
cd todayiwill && cargo build --release

build-doc:
cd todayiwill && cargo doc --no-deps
@echo '<meta http-equiv="refresh" content="0;url=todayiwill/index.html">' > todayiwill/target/doc/index.html

build-deb:
fpm -s dir \
-t deb \
-n todayiwill \
-v $(VERSION) \
--license LICENSE \
--description "A CLI reminder app that offers a simple yet powerful solution to enhance productivity and ensure that you stay on top of your daily responsibilities" \
--maintainer "Vinicius Mayrink <[email protected]>" \
todayiwill/target/release/todayiwill=/usr/bin/todayiwill
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,21 @@ $ todayiwill list

![gif showing the installation process](https://raw.githubusercontent.com/vncsmyrnk/todayiwill/main/assets/install.gif)

### Ubuntu/debian
All packages are made to `x86_64` architecture.

### Ubuntu/debian (bash)

```bash
bash <(wget -O- https://github.com/vncsmyrnk/todayiwill/releases/latest/download/install-linux-debian.sh 2> /dev/null)
```

### Ubuntu/debian (`deb` package)

```bash
curl -L -O https://github.com/vncsmyrnk/todayiwill/releases/latest/download/todayiwill_0.6.0_amd64.deb # or other version
sudo apt install ./todayiwill_0.6.0_amd64.deb
```

### Homebrew

```bash
Expand Down

0 comments on commit 55c6fef

Please sign in to comment.