Skip to content

Commit a13a187

Browse files
committed
Bump to v1.0.1
1 parent 2ab81b9 commit a13a187

File tree

4 files changed

+134
-33
lines changed

4 files changed

+134
-33
lines changed

.github/workflows/external-pcap-service.yml

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ on:
2121

2222
jobs:
2323
build-linux:
24-
runs-on: ubuntu-latest
24+
runs-on: ubuntu-22.04
2525

2626
steps:
2727
- name: Checkout repository
@@ -133,17 +133,33 @@ jobs:
133133
run: |
134134
mkdir -p dist/packages
135135
136-
# Copy packages from script build directories
137-
find scripts -name "*.deb" -exec cp {} dist/packages/ \; 2>/dev/null || echo "No .deb files found"
138-
find scripts -name "*.rpm" -exec cp {} dist/packages/ \; 2>/dev/null || echo "No .rpm files found"
139-
find scripts -name "*.pkg.tar.*" -exec cp {} dist/packages/ \; 2>/dev/null || echo "No .pkg.tar.* files found"
136+
# Debug: List what files exist after build
137+
echo "=== Files in dist/ directory ==="
138+
ls -la dist/ || echo "dist/ directory is empty or doesn't exist"
139+
echo ""
140+
echo "=== Files in scripts/ directory tree ==="
141+
find scripts -type f -name "*.deb" -o -name "*.rpm" -o -name "*.pkg.tar.*" | head -20 || echo "No package files found in scripts/"
142+
echo ""
143+
144+
# Copy packages - check both locations to be safe
145+
# All build scripts should move final packages to dist/, but let's check both
146+
147+
# First, copy from dist/ directory (primary location)
148+
find dist -maxdepth 1 -name "*.deb" -exec cp {} dist/packages/ \; 2>/dev/null || echo "No .deb files found in dist/"
149+
find dist -maxdepth 1 -name "*.rpm" -exec cp {} dist/packages/ \; 2>/dev/null || echo "No .rpm files found in dist/"
150+
find dist -maxdepth 1 -name "*.pkg.tar.*" -exec cp {} dist/packages/ \; 2>/dev/null || echo "No .pkg.tar.* files found in dist/"
151+
152+
# Also check scripts/ directory as fallback (in case move failed)
153+
find scripts -name "*.deb" -exec cp {} dist/packages/ \; 2>/dev/null || echo "No .deb files found in scripts/"
154+
find scripts -name "*.rpm" -exec cp {} dist/packages/ \; 2>/dev/null || echo "No .rpm files found in scripts/"
155+
find scripts -name "*.pkg.tar.*" -exec cp {} dist/packages/ \; 2>/dev/null || echo "No .pkg.tar.* files found in scripts/"
140156
141157
# Copy source distribution and standalone binary
142158
cp -v dist/*.tar.gz dist/packages/ 2>/dev/null || echo "No .tar.gz files found"
143159
cp -v whatpulse-pcap-service-${{ steps.version.outputs.version }}-linux-amd64 dist/packages/
144160
145161
echo "📦 Final artifacts:"
146-
ls -la ../dist/packages/
162+
ls -la dist/packages/
147163
148164
- name: Generate checksums
149165
run: |
@@ -158,6 +174,10 @@ jobs:
158174
path: dist/packages/
159175
retention-days: 30
160176

177+
- name: Get build date
178+
id: date
179+
run: echo "date=$(date -u +"%Y-%m-%d %H:%M:%S UTC")" >> $GITHUB_OUTPUT
180+
161181
- name: Create GitHub Release
162182
if: |
163183
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')) ||
@@ -174,7 +194,7 @@ jobs:
174194
---
175195
176196
**Built from commit:** ${{ github.sha }}
177-
**Build date:** $(date -u +"%Y-%m-%d %H:%M:%S UTC")
197+
**Build date:** ${{ steps.date.outputs.date }}
178198
files: |
179199
dist/packages/*
180200
draft: false

README.md

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,38 +14,55 @@ When WhatPulse runs as an AppImage or in other restricted environments, it may n
1414

1515
### Package Manager Installation (Recommended)
1616

17+
Download the latest packages from the [GitHub Releases page](https://github.com/whatpulse/external-pcap-service/releases/latest).
18+
1719
Choose the package format for your Linux distribution:
1820

1921
#### Debian/Ubuntu (.deb)
2022
```bash
21-
wget https://releases.whatpulse.org/latest/external-pcap-service/whatpulse-pcap-service_1.0.0_amd64.deb
22-
sudo dpkg -i whatpulse-pcap-service_1.0.0_amd64.deb
23+
# Download from releases page, then:
24+
sudo dpkg -i whatpulse-pcap-service_*_amd64.deb
2325
sudo apt-get install -f # Fix any missing dependencies
2426
```
2527

2628
#### Red Hat/Fedora/CentOS (.rpm)
2729
```bash
28-
wget https://releases.whatpulse.org/latest/external-pcap-service/whatpulse-pcap-service-1.0.0-1.x86_64.rpm
29-
sudo rpm -ivh whatpulse-pcap-service-1.0.0-1.x86_64.rpm
30+
# Download from releases page, then:
31+
sudo rpm -ivh whatpulse-pcap-service-*-1.x86_64.rpm
3032
# OR on Fedora/newer systems:
31-
sudo dnf install whatpulse-pcap-service-1.0.0-1.x86_64.rpm
33+
sudo dnf install whatpulse-pcap-service-*-1.x86_64.rpm
34+
```
35+
36+
#### Arch Linux (.pkg.tar.*)
37+
```bash
38+
# Download from releases page, then:
39+
sudo pacman -U whatpulse-pcap-service-*-1-x86_64.pkg.tar.*
3240
```
3341

34-
#### Arch Linux (.pkg.tar.xz)
42+
### Quick Download Commands
43+
44+
For automated downloads, use these commands to get the latest release:
45+
3546
```bash
36-
wget https://releases.whatpulse.org/latest/external-pcap-service/whatpulse-pcap-service-1.0.0-1-x86_64.pkg.tar.xz
37-
sudo pacman -U whatpulse-pcap-service-1.0.0-1-x86_64.pkg.tar.xz
47+
# Get latest release info
48+
LATEST_URL=$(curl -s https://api.github.com/repos/whatpulse/external-pcap-service/releases/latest | grep "browser_download_url" | grep "deb" | cut -d '"' -f 4)
49+
wget "$LATEST_URL"
50+
51+
# Or browse all releases:
52+
# https://github.com/whatpulse/external-pcap-service/releases
3853
```
3954

4055
### Build from Source
4156

42-
If packages aren't available for your distribution:
57+
If packages aren't available for your distribution, or you prefer to build from source:
4358

4459
```bash
45-
# Download and extract source
46-
wget https://releases.whatpulse.org/latest/external-pcap-service/whatpulse-pcap-service-1.0.0-source.tar.gz
47-
tar xzf whatpulse-pcap-service-1.0.0-source.tar.gz
48-
cd whatpulse-pcap-service-1.0.0
60+
# Download and extract source from GitHub releases
61+
# Visit: https://github.com/whatpulse/external-pcap-service/releases
62+
# Download: whatpulse-pcap-service-VERSION-source.tar.gz
63+
64+
tar xzf whatpulse-pcap-service-*-source.tar.gz
65+
cd whatpulse-pcap-service-*
4966

5067
# Install build dependencies
5168
# Debian/Ubuntu:

pcapservice.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#include <set>
2929
#include <cstdint>
3030

31-
#define PCAP_SERVICE_VERSION "1.0.0"
31+
#define PCAP_SERVICE_VERSION "1.0.1"
3232

3333
/**
3434
* Main service class that manages PCap capture and network communication

release.sh

Lines changed: 76 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,43 @@
22
set -e
33

44
# External PCap Service Release Helper Script
5-
# Usage: ./release.sh <version> [--push]
5+
# Usage: ./release.sh <version> [--push] [--force]
66

77
VERSION="$1"
8-
PUSH_FLAG="$2"
8+
PUSH_FLAG=""
9+
FORCE_FLAG=""
10+
11+
# Parse arguments
12+
shift
13+
while [[ $# -gt 0 ]]; do
14+
case $1 in
15+
--push)
16+
PUSH_FLAG="--push"
17+
shift
18+
;;
19+
--force)
20+
FORCE_FLAG="--force"
21+
shift
22+
;;
23+
*)
24+
echo "Unknown option: $1"
25+
exit 1
26+
;;
27+
esac
28+
done
929

1030
if [ -z "$VERSION" ]; then
11-
echo "Usage: $0 <version> [--push]"
31+
echo "Usage: $0 <version> [--push] [--force]"
1232
echo ""
1333
echo "Examples:"
14-
echo " $0 1.0.1 # Prepare release (update version, commit, create tag)"
15-
echo " $0 1.0.1 --push # Prepare and push to trigger GitHub Actions"
34+
echo " $0 1.0.1 # Prepare release (update version, commit, create tag)"
35+
echo " $0 1.0.1 --push # Prepare and push to trigger GitHub Actions"
36+
echo " $0 1.0.1 --force # Force overwrite existing version/tag"
37+
echo " $0 1.0.1 --push --force # Force overwrite and push immediately"
38+
echo ""
39+
echo "Options:"
40+
echo " --push Push changes and tag to remote repository immediately"
41+
echo " --force Overwrite existing version/tag, force push if needed"
1642
echo ""
1743
exit 1
1844
fi
@@ -37,8 +63,12 @@ CURRENT_VERSION=$(grep '#define PCAP_SERVICE_VERSION ' pcapservice.h | awk -F '"
3763
echo "Current version in source: $CURRENT_VERSION"
3864
echo "Target version: $VERSION"
3965

40-
if [ "$CURRENT_VERSION" = "$VERSION" ]; then
66+
if [ "$CURRENT_VERSION" = "$VERSION" ] && [ -z "$FORCE_FLAG" ]; then
4167
echo "⚠️ Version is already set to $VERSION in source code"
68+
echo " Use --force to overwrite existing version"
69+
exit 1
70+
elif [ "$CURRENT_VERSION" = "$VERSION" ] && [ -n "$FORCE_FLAG" ]; then
71+
echo "⚠️ Version is already set to $VERSION in source code (--force specified, continuing)"
4272
else
4373
echo "📝 Updating version in source code..."
4474
sed -i.bak "s/#define PCAP_SERVICE_VERSION \".*\"/#define PCAP_SERVICE_VERSION \"$VERSION\"/" pcapservice.h
@@ -50,7 +80,12 @@ fi
5080
if ! git diff --quiet pcapservice.h; then
5181
echo "📦 Committing version update..."
5282
git add pcapservice.h
53-
git commit -m "bump version to $VERSION"
83+
if [ -n "$FORCE_FLAG" ]; then
84+
# Force commit even if there might be conflicts
85+
git commit -m "bump version to $VERSION" || git commit --amend -m "bump version to $VERSION"
86+
else
87+
git commit -m "bump version to $VERSION"
88+
fi
5489
echo "✅ Version update committed"
5590
else
5691
echo "ℹ️ No changes to commit"
@@ -59,7 +94,16 @@ fi
5994
# Create tag
6095
TAG_NAME="v$VERSION"
6196
if git rev-parse "$TAG_NAME" >/dev/null 2>&1; then
62-
echo "⚠️ Tag $TAG_NAME already exists"
97+
if [ -n "$FORCE_FLAG" ]; then
98+
echo "⚠️ Tag $TAG_NAME already exists (--force specified, recreating)"
99+
git tag -d "$TAG_NAME" # Delete local tag
100+
git tag -a "$TAG_NAME" -m "External PCap Service v$VERSION"
101+
echo "✅ Tag $TAG_NAME recreated"
102+
else
103+
echo "⚠️ Tag $TAG_NAME already exists"
104+
echo " Use --force to overwrite existing tag"
105+
exit 1
106+
fi
63107
else
64108
echo "🏷️ Creating tag $TAG_NAME..."
65109
git tag -a "$TAG_NAME" -m "External PCap Service v$VERSION"
@@ -72,22 +116,42 @@ echo ""
72116

73117
if [ "$PUSH_FLAG" = "--push" ]; then
74118
echo "🚢 Pushing changes and tag to trigger GitHub Actions..."
75-
git push origin HEAD
76-
git push origin "$TAG_NAME"
119+
120+
if [ -n "$FORCE_FLAG" ]; then
121+
echo " Using --force push for tag (will overwrite remote tag if exists)"
122+
git push origin HEAD
123+
git push origin "$TAG_NAME" --force
124+
else
125+
git push origin HEAD
126+
git push origin "$TAG_NAME"
127+
fi
128+
77129
echo ""
78130
echo "✅ Changes pushed! GitHub Actions will now build and release."
79131
echo " View progress at: https://github.com/whatpulse/linux-external-pcap-service/actions"
80132
else
81133
echo "Next steps:"
82134
echo "1. Review the changes: git log --oneline -n 2"
83-
echo "2. Push to trigger release: git push origin HEAD && git push origin $TAG_NAME"
84-
echo " Or run: $0 $VERSION --push"
135+
136+
if [ -n "$FORCE_FLAG" ]; then
137+
echo "2. Push to trigger release (with force): git push origin HEAD && git push origin $TAG_NAME --force"
138+
echo " Or run: $0 $VERSION --push --force"
139+
else
140+
echo "2. Push to trigger release: git push origin HEAD && git push origin $TAG_NAME"
141+
echo " Or run: $0 $VERSION --push"
142+
fi
143+
85144
echo ""
86145
echo "The GitHub Actions workflow will automatically:"
87146
echo "• Build the service for Linux"
88147
echo "• Create packages (deb, rpm, binary)"
89148
echo "• Generate checksums"
90149
echo "• Create GitHub release with all assets"
150+
151+
if [ -n "$FORCE_FLAG" ]; then
152+
echo ""
153+
echo "⚠️ Force mode enabled - this will overwrite existing releases!"
154+
fi
91155
fi
92156

93157
echo ""

0 commit comments

Comments
 (0)