Skip to content

Commit 6f803f0

Browse files
committed
chore: Improves release workflow
1 parent 24f6be7 commit 6f803f0

File tree

8 files changed

+31
-18
lines changed

8 files changed

+31
-18
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "dispenser"
3-
version = "0.7.0"
3+
version = "0.8.0"
44
edition = "2021"
55
license = "MIT"
66

INSTALL.deb.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ wget ...
2121

2222

2323
```sh
24-
sudo apt install ./dispenser-0.7-0.x86_64.deb
24+
sudo apt install ./dispenser-0.8.0-0.x86_64.deb
2525
```
2626

2727
You can validate that it was successfully installed by switching to the

INSTALL.redhat.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ wget ...
2323

2424

2525
```sh
26-
sudo dnf install ./dispenser-0.7-0.x86_64.rpm
26+
sudo dnf install ./dispenser-0.8.0-0.x86_64.rpm
2727
```
2828

2929
You can validate that it was successfully installed by switching to the

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ Download the latest `.deb` or `.rpm` package from the [releases page](https://gi
3030

3131
```sh
3232
# Download the .deb package
33-
# wget https://github.com/ixpantia/dispenser/releases/download/v0.7.0/dispenser-0.7-0.x86_64.deb
33+
# wget https://github.com/ixpantia/dispenser/releases/download/v0.8.0/dispenser-0.8.0-0.x86_64.deb
3434

35-
sudo apt install ./dispenser-0.7-0.x86_64.deb
35+
sudo apt install ./dispenser-0.8.0-0.x86_64.deb
3636
```
3737

3838
### RHEL / CentOS / Fedora
@@ -41,7 +41,7 @@ sudo apt install ./dispenser-0.7-0.x86_64.deb
4141
# Download the .rpm package
4242
# wget ...
4343

44-
sudo dnf install ./dispenser-0.7-0.x86_64.rpm
44+
sudo dnf install ./dispenser-0.8.0-0.x86_64.rpm
4545
```
4646

4747
The installation process will:

deb/DEBIAN/control

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: dispenser
2-
Version: 0.7
2+
Version: VERSION_PLACEHOLDER
33
Maintainer: ixpantia S.A.
44
Architecture: amd64
55
Description: Continously Deploy services with Docker Compose

justfile

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
# justfile for dispenser project
22

3-
DISPENSER_VERSION := "0.7"
3+
DISPENSER_VERSION := shell('grep "^version" Cargo.toml | head -n1 | cut -d \" -f 2')
44
TARGET_BIN := "target/x86_64-unknown-linux-musl/release/dispenser"
5-
USR_BIN_DEB := "deb/usr/local/bin/dispenser"
65
USR_BIN_RPM := "rpm/usr/local/bin/dispenser"
76

7+
version:
8+
echo "{{DISPENSER_VERSION}}"
9+
810
build:
911
CARGO_TARGET_DIR="./target" cargo build --release --target "x86_64-unknown-linux-musl"
1012

1113
build-deb: build
12-
mkdir -p deb/usr/local/bin/
13-
rm -f {{USR_BIN_DEB}}
14-
mv {{TARGET_BIN}} {{USR_BIN_DEB}}
15-
dpkg-deb --build deb
16-
rm -f dispenser.deb
17-
mv deb.deb dispenser-{{DISPENSER_VERSION}}-0.x86_64.deb
14+
rm -rf target/deb_stage
15+
mkdir -p target/deb_stage
16+
cp -R deb/* target/deb_stage/
17+
mkdir -p target/deb_stage/usr/local/bin
18+
cp {{TARGET_BIN}} target/deb_stage/usr/local/bin/dispenser
19+
sed 's/VERSION_PLACEHOLDER/{{DISPENSER_VERSION}}/' deb/DEBIAN/control > target/deb_stage/DEBIAN/control
20+
dpkg-deb --build target/deb_stage dispenser-{{DISPENSER_VERSION}}-0.x86_64.deb
1821

1922
build-rpm: build
2023
rm -rf rpmstage rpmout
@@ -24,4 +27,14 @@ build-rpm: build
2427
mkdir -p rpmout
2528
cp {{TARGET_BIN}} rpmstage/usr/local/bin/dispenser
2629
cp rpm/usr/lib/systemd/system/dispenser.service rpmstage/usr/lib/systemd/system/
27-
rpmbuild --target=x86_64 --buildroot $(pwd)/rpmstage --define "_topdir $(pwd)/rpmout" -bb rpm/dispenser.spec --noclean
30+
rpmbuild --target=x86_64 --buildroot $(pwd)/rpmstage --define "_topdir $(pwd)/rpmout" --define "version {{DISPENSER_VERSION}}" -bb rpm/dispenser.spec --noclean
31+
32+
# Usage: just bump 0.8.0
33+
bump NEW_VERSION:
34+
@echo "Bumping version to {{NEW_VERSION}}..."
35+
# Update Cargo.toml
36+
sed -i '' 's/^version = ".*"/version = "{{NEW_VERSION}}"/' Cargo.toml
37+
# Update Documentation (URLs and filenames)
38+
sed -i '' -E 's/v[0-9]+\.[0-9]+\.[0-9]+/v{{NEW_VERSION}}/g' README.md INSTALL*.md
39+
sed -i '' -E 's/dispenser-[0-9]+\.[0-9]+/dispenser-{{NEW_VERSION}}/g' README.md INSTALL*.md
40+
@echo "Done. Don't forget to commit and tag!"

rpm/dispenser.spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Name: dispenser
2-
Version: 0.7
2+
Version: %{version}
33
Release: 0
44
Summary: Continously Deploy services with Docker Compose
55
License: see /usr/share/doc/dispenser/copyright

0 commit comments

Comments
 (0)