From 0849752d331d69f35312231f0b5ced576221c6b9 Mon Sep 17 00:00:00 2001 From: Victor Wildner Date: Mon, 10 Nov 2025 23:43:46 +0100 Subject: [PATCH 1/8] feat(debian, rpm): add package management scripts and metadata - Added post-installation and post-removal scripts for Debian and RPM packages - Included configuration for passwordless sudo for required commands - Updated .gitignore to exclude binary packages - Enhanced Cargo.toml with package metadata and descriptions - Improved README with installation instructions for binary packages --- .gitignore | 11 ++++++++--- Cargo.toml | 42 ++++++++++++++++++++++++++++++++++++++++++ Makefile | 35 ++++++++++++++++++++++++++++++++++- README.md | 33 +++++++++++++++++++++++++++++++++ debian/postinst | 42 ++++++++++++++++++++++++++++++++++++++++++ debian/postrm | 20 ++++++++++++++++++++ debian/prerm | 14 ++++++++++++++ rpm/post-install.sh | 38 ++++++++++++++++++++++++++++++++++++++ rpm/post-uninstall.sh | 16 ++++++++++++++++ rpm/pre-uninstall.sh | 10 ++++++++++ 10 files changed, 257 insertions(+), 4 deletions(-) create mode 100644 debian/postinst create mode 100644 debian/postrm create mode 100644 debian/prerm create mode 100644 rpm/post-install.sh create mode 100644 rpm/post-uninstall.sh create mode 100644 rpm/pre-uninstall.sh diff --git a/.gitignore b/.gitignore index 0b4573f..8b14c32 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,4 @@ -.github -!.github/workflows/ -!.github/workflows/*.yml +.github/prompts debug/ traces/ # Added by cargo @@ -33,6 +31,13 @@ build.rs *.dylib *.dll +# Binary packages +*.deb +*.rpm +*.tar.gz +*.zip +SHA256SUMS.txt + # Configuration files that may contain secrets (never commit) config.toml *.key diff --git a/Cargo.toml b/Cargo.toml index 9e95d9b..a363d6a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,10 +6,52 @@ resolver = "2" name = "akon" version = "1.1.1" edition = "2021" +authors = ["vcwild"] +description = "A CLI tool for managing VPN connections with OpenConnect" +license = "MIT" +repository = "https://github.com/vcwild/akon" +homepage = "https://github.com/vcwild/akon" +readme = "README.md" +keywords = ["vpn", "openconnect", "cli", "networking"] +categories = ["command-line-utilities", "network-programming"] [lints.rust] dead_code = "deny" +# Debian package metadata for cargo-deb +[package.metadata.deb] +maintainer = "vcwild" +copyright = "2025, vcwild" +license-file = ["LICENSE", "4"] +extended-description = """\ +akon is a command-line tool for managing VPN connections using OpenConnect. +It provides an easy-to-use interface for connecting to VPN servers with support +for automatic reconnection, health checks, and daemon mode operation.""" +depends = "openconnect, procps" +section = "net" +priority = "optional" +assets = [ + ["target/release/akon", "usr/bin/", "755"], + ["README.md", "usr/share/doc/akon/", "644"], + ["LICENSE", "usr/share/doc/akon/", "644"], +] +maintainer-scripts = "debian/" + +# RPM package metadata for cargo-generate-rpm +[package.metadata.generate-rpm] +assets = [ + { source = "target/release/akon", dest = "/usr/bin/akon", mode = "755" }, + { source = "README.md", dest = "/usr/share/doc/akon/README.md", mode = "644" }, + { source = "LICENSE", dest = "/usr/share/doc/akon/LICENSE", mode = "644" }, +] +post_install_script = "rpm/post-install.sh" +pre_uninstall_script = "rpm/pre-uninstall.sh" +post_uninstall_script = "rpm/post-uninstall.sh" + +[package.metadata.generate-rpm.requires] +openconnect = "*" +procps-ng = "*" + [[bin]] name = "akon" path = "src/main.rs" diff --git a/Makefile b/Makefile index 15d94ff..81cffc3 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: all install install-dev +.PHONY: all install install-dev deps build-deb build-rpm package-all # Default target - build release binary all: @@ -112,3 +112,36 @@ deps: exit 0; \ ;; \ esac' + +# Build .deb package for Ubuntu/Debian +build-deb: all + @echo "Building .deb package..." + @if ! command -v cargo-deb &> /dev/null; then \ + echo "Installing cargo-deb..."; \ + cargo install cargo-deb; \ + fi + cargo deb --no-build + @echo "✓ Package created: $$(ls -1 target/debian/*.deb | tail -1)" + @echo "" + @echo "Install with:" + @echo " sudo dpkg -i $$(ls -1 target/debian/*.deb | tail -1)" + +# Build .rpm package for Fedora/RHEL +build-rpm: all + @echo "Building .rpm package..." + @if ! command -v cargo-generate-rpm &> /dev/null; then \ + echo "Installing cargo-generate-rpm..."; \ + cargo install cargo-generate-rpm; \ + fi + cargo generate-rpm + @echo "✓ Package created: $$(ls -1 target/generate-rpm/*.rpm | tail -1)" + @echo "" + @echo "Install with:" + @echo " sudo rpm -i $$(ls -1 target/generate-rpm/*.rpm | tail -1)" + +# Build both packages +package-all: build-deb build-rpm + @echo "" + @echo "All packages built successfully!" + @echo "DEB: $$(ls -1 target/debian/*.deb | tail -1)" + @echo "RPM: $$(ls -1 target/generate-rpm/*.rpm | tail -1)" diff --git a/README.md b/README.md index 7965114..b73c44c 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,39 @@ This design eliminates FFI complexity while maintaining full OpenConnect functio ## Installation +### Binary Packages (Recommended) + +Download pre-built packages for your distribution from the [GitHub Releases](https://github.com/vcwild/akon/releases) page. + +#### Ubuntu/Debian + +```bash +# Download the latest .deb package +wget https://github.com/vcwild/akon/releases/download/v1.1.1/akon_1.1.1_amd64.deb + +# Install the package +sudo dpkg -i akon_1.1.1_amd64.deb + +# If there are dependency issues, run: +sudo apt-get install -f +``` + +#### Fedora/RHEL + +```bash +# Download the latest .rpm package +wget https://github.com/vcwild/akon/releases/download/v1.1.1/akon-1.1.1-1.x86_64.rpm + +# Install the package +sudo dnf install ./akon-1.1.1-1.x86_64.rpm +``` + +**What the packages do:** +- Install binary to `/usr/bin/akon` +- Configure passwordless sudo for openconnect, pkill, and kill +- Install documentation to `/usr/share/doc/akon/` +- Set up all dependencies automatically + ### From Source ```bash diff --git a/debian/postinst b/debian/postinst new file mode 100644 index 0000000..024c40a --- /dev/null +++ b/debian/postinst @@ -0,0 +1,42 @@ +#!/bin/sh +set -e + +# Post-installation script for akon +# Configures passwordless sudo for required commands + +OPENCONNECT_PATH=$(command -v openconnect) +PKILL_PATH=$(command -v pkill) +KILL_PATH=$(command -v kill || echo "/usr/bin/kill") + +# Create sudoers.d file for akon +SUDOERS_FILE="/etc/sudoers.d/akon" + +cat > "$SUDOERS_FILE" << EOF +# Allow all users to run akon-required commands without password +# This file is automatically managed by the akon package +ALL ALL=(ALL) NOPASSWD: $OPENCONNECT_PATH +ALL ALL=(ALL) NOPASSWD: $PKILL_PATH +ALL ALL=(ALL) NOPASSWD: $KILL_PATH +EOF + +# Set proper permissions on sudoers file +chmod 0440 "$SUDOERS_FILE" + +# Verify the sudoers file syntax +if ! visudo -c -f "$SUDOERS_FILE" >/dev/null 2>&1; then + echo "Warning: sudoers file has syntax errors. Please check /etc/sudoers.d/akon" + rm -f "$SUDOERS_FILE" + exit 1 +fi + +echo "akon has been installed successfully!" +echo "The following commands are now available without sudo password:" +echo " - openconnect" +echo " - pkill" +echo " - kill" +echo "" +echo "Run 'akon --help' to get started." + +#DEBHELPER# + +exit 0 diff --git a/debian/postrm b/debian/postrm new file mode 100644 index 0000000..81b2390 --- /dev/null +++ b/debian/postrm @@ -0,0 +1,20 @@ +#!/bin/sh +set -e + +# Post-removal script for akon +# Removes sudoers configuration file + +SUDOERS_FILE="/etc/sudoers.d/akon" + +# Remove sudoers file if package is being purged +if [ "$1" = "purge" ]; then + rm -f "$SUDOERS_FILE" + echo "akon configuration has been removed." +fi + +# Clean up any temporary state files +rm -f /tmp/akon_vpn_state.json 2>/dev/null || true + +#DEBHELPER# + +exit 0 diff --git a/debian/prerm b/debian/prerm new file mode 100644 index 0000000..e0e36e8 --- /dev/null +++ b/debian/prerm @@ -0,0 +1,14 @@ +#!/bin/sh +set -e + +# Pre-removal script for akon +# Cleans up sudoers configuration + +# Stop any running akon daemon +if command -v akon >/dev/null 2>&1; then + akon off 2>/dev/null || true +fi + +#DEBHELPER# + +exit 0 diff --git a/rpm/post-install.sh b/rpm/post-install.sh new file mode 100644 index 0000000..f0f9acd --- /dev/null +++ b/rpm/post-install.sh @@ -0,0 +1,38 @@ +#!/bin/sh +# RPM post-installation script for akon +# Configures passwordless sudo for required commands + +OPENCONNECT_PATH=$(command -v openconnect) +PKILL_PATH=$(command -v pkill) +KILL_PATH=$(command -v kill || echo "/usr/bin/kill") + +# Create sudoers.d file for akon +SUDOERS_FILE="/etc/sudoers.d/akon" + +cat > "$SUDOERS_FILE" << EOF +# Allow all users to run akon-required commands without password +# This file is automatically managed by the akon package +ALL ALL=(ALL) NOPASSWD: $OPENCONNECT_PATH +ALL ALL=(ALL) NOPASSWD: $PKILL_PATH +ALL ALL=(ALL) NOPASSWD: $KILL_PATH +EOF + +# Set proper permissions on sudoers file +chmod 0440 "$SUDOERS_FILE" + +# Verify the sudoers file syntax +if ! visudo -c -f "$SUDOERS_FILE" >/dev/null 2>&1; then + echo "Warning: sudoers file has syntax errors. Please check /etc/sudoers.d/akon" + rm -f "$SUDOERS_FILE" + exit 1 +fi + +echo "akon has been installed successfully!" +echo "The following commands are now available without sudo password:" +echo " - openconnect" +echo " - pkill" +echo " - kill" +echo "" +echo "Run 'akon --help' to get started." + +exit 0 diff --git a/rpm/post-uninstall.sh b/rpm/post-uninstall.sh new file mode 100644 index 0000000..daca011 --- /dev/null +++ b/rpm/post-uninstall.sh @@ -0,0 +1,16 @@ +#!/bin/sh +# RPM post-uninstall script for akon +# Removes sudoers configuration file + +SUDOERS_FILE="/etc/sudoers.d/akon" + +# Remove sudoers file on uninstall (not on upgrade) +if [ $1 -eq 0 ]; then + rm -f "$SUDOERS_FILE" + echo "akon configuration has been removed." + + # Clean up any temporary state files + rm -f /tmp/akon_vpn_state.json 2>/dev/null || true +fi + +exit 0 diff --git a/rpm/pre-uninstall.sh b/rpm/pre-uninstall.sh new file mode 100644 index 0000000..5c2c0f1 --- /dev/null +++ b/rpm/pre-uninstall.sh @@ -0,0 +1,10 @@ +#!/bin/sh +# RPM pre-uninstall script for akon +# Stops any running akon daemon + +# Stop any running akon daemon +if command -v akon >/dev/null 2>&1; then + akon off 2>/dev/null || true +fi + +exit 0 From 9f742c718cf8ed2e6010fe76b508856cb01e3d03 Mon Sep 17 00:00:00 2001 From: Victor Wildner Date: Mon, 10 Nov 2025 23:45:25 +0100 Subject: [PATCH 2/8] feat(release): add GitHub Actions release pipeline - Implement release pipeline for building and publishing packages - Support for both Ubuntu (.deb) and Fedora (.rpm) packages - Include steps for testing, building, and uploading artifacts - Create GitHub release with generated packages and checksums --- .github/workflows/release.yml | 262 ++++++++++++++++++++++++++++++++++ 1 file changed, 262 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..07cfe00 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,262 @@ +# Release Pipeline for akon +# Builds and publishes binary packages for Ubuntu and Fedora +--- +name: Release + +on: + push: + tags: + - 'v*.*.*' + pull_request: + paths: + - '.github/workflows/release.yml' + - 'Cargo.toml' + - 'debian/**' + - 'rpm/**' + workflow_dispatch: + inputs: + version: + description: 'Version to release (e.g., 1.1.1)' + required: true + type: string + +env: + CARGO_TERM_COLOR: always + +jobs: + # Test package building on PRs (no release) + test-packages: + name: Test Package Building + if: github.event_name == 'pull_request' + strategy: + matrix: + include: + - os: ubuntu-latest + package: deb + - os: ubuntu-latest + package: rpm + container: fedora:latest + runs-on: ${{ matrix.os }} + container: ${{ matrix.container }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install system dependencies (Ubuntu) + if: matrix.package == 'deb' + run: make deps + + - name: Install build dependencies (Fedora) + if: matrix.package == 'rpm' + run: | + dnf install -y \ + gcc \ + gcc-c++ \ + make \ + openssl-devel \ + pkg-config \ + rpm-build \ + rpmdevtools \ + git \ + curl + + - name: Setup Rust toolchain (Ubuntu) + if: matrix.package == 'deb' + uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + toolchain: stable + + - name: Setup Rust toolchain (Fedora) + if: matrix.package == 'rpm' + run: | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \ + | sh -s -- -y + source $HOME/.cargo/env + echo "$HOME/.cargo/bin" >> $GITHUB_PATH + + - name: Install packaging tools + run: | + if [ "${{ matrix.package }}" = "deb" ]; then + cargo install cargo-deb + else + source $HOME/.cargo/env + cargo install cargo-generate-rpm + fi + + - name: Build release binary + run: | + if [ "${{ matrix.package }}" = "rpm" ]; then + source $HOME/.cargo/env + fi + cargo build --release --verbose + + - name: Build package + run: | + if [ "${{ matrix.package }}" = "deb" ]; then + cargo deb --no-build + echo "Package built: $(ls -1 target/debian/*.deb)" + else + source $HOME/.cargo/env + cargo generate-rpm + echo "Package built: $(ls -1 target/generate-rpm/*.rpm)" + fi + + - name: Upload test package + uses: actions/upload-artifact@v4 + with: + name: test-${{ matrix.package }}-package + path: | + target/debian/*.deb + target/generate-rpm/*.rpm + retention-days: 7 + + # Build Ubuntu .deb package for release + build-deb: + if: >- + startsWith(github.ref, 'refs/tags/') || + github.event_name == 'workflow_dispatch' + name: Build Ubuntu .deb Package + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install system dependencies + run: make deps + + - name: Setup Rust toolchain + uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + toolchain: stable + + - name: Install cargo-deb + run: cargo install cargo-deb + + - name: Build release binary + run: cargo build --release --verbose + + - name: Build .deb package + run: cargo deb --no-build + + - name: Get package version + id: version + run: | + if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then + echo "version=${{ inputs.version }}" >> $GITHUB_OUTPUT + else + echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT + fi + + - name: Upload .deb artifact + uses: actions/upload-artifact@v4 + with: + name: akon-${{ steps.version.outputs.version }}-amd64.deb + path: target/debian/*.deb + retention-days: 90 + + # Build Fedora .rpm package + build-rpm: + name: Build Fedora .rpm Package + runs-on: ubuntu-latest + container: + image: fedora:latest + steps: + - name: Install build dependencies + run: | + dnf install -y \ + gcc \ + gcc-c++ \ + make \ + openssl-devel \ + pkg-config \ + rpm-build \ + rpmdevtools \ + git \ + curl + + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Rust toolchain + run: | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \ + | sh -s -- -y + source $HOME/.cargo/env + echo "$HOME/.cargo/bin" >> $GITHUB_PATH + + - name: Install cargo-generate-rpm + run: | + source $HOME/.cargo/env + cargo install cargo-generate-rpm + + - name: Build release binary + run: | + source $HOME/.cargo/env + cargo build --release --verbose + + - name: Generate .rpm package + run: | + source $HOME/.cargo/env + cargo generate-rpm + + - name: Get package version + id: version + run: | + if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then + echo "version=${{ inputs.version }}" >> $GITHUB_OUTPUT + else + echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT + fi + + - name: Upload .rpm artifact + uses: actions/upload-artifact@v4 + with: + name: akon-${{ steps.version.outputs.version }}-1.x86_64.rpm + path: target/generate-rpm/*.rpm + retention-days: 90 + + # Create GitHub Release with packages + create-release: + name: Create GitHub Release + runs-on: ubuntu-latest + needs: [build-deb, build-rpm] + if: startsWith(github.ref, 'refs/tags/') + permissions: + contents: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Get version + id: version + run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT + + - name: Download .deb artifact + uses: actions/download-artifact@v4 + with: + name: akon-${{ steps.version.outputs.version }}-amd64.deb + path: ./packages + + - name: Download .rpm artifact + uses: actions/download-artifact@v4 + with: + name: akon-${{ steps.version.outputs.version }}-1.x86_64.rpm + path: ./packages + + - name: Generate checksums + run: | + cd packages + sha256sum *.deb *.rpm > SHA256SUMS.txt + + - name: Create Release + uses: softprops/action-gh-release@v1 + with: + files: | + packages/*.deb + packages/*.rpm + packages/SHA256SUMS.txt + generate_release_notes: true + draft: false + prerelease: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 62c5349a3d75bcc414798c565b322c18f1ee2e2c Mon Sep 17 00:00:00 2001 From: Victor Wildner Date: Tue, 11 Nov 2025 00:02:10 +0100 Subject: [PATCH 3/8] fix(release): update Fedora dependency installation - Changed step name to clarify installation of system dependencies for Fedora - Added comments to explain the installation of base build tools and runtime dependencies - Ensured runtime dependencies are installed via `make deps` --- .github/workflows/release.yml | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 07cfe00..ecd9343 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -46,19 +46,21 @@ jobs: if: matrix.package == 'deb' run: make deps - - name: Install build dependencies (Fedora) + - name: Install system dependencies (Fedora) if: matrix.package == 'rpm' run: | + # Install base build tools and package building tools dnf install -y \ gcc \ gcc-c++ \ make \ openssl-devel \ - pkg-config \ - rpm-build \ - rpmdevtools \ git \ - curl + curl \ + rpm-build \ + rpmdevtools + # Install runtime deps via make deps + make deps - name: Setup Rust toolchain (Ubuntu) if: matrix.package == 'deb' @@ -163,16 +165,18 @@ jobs: steps: - name: Install build dependencies run: | + # Install base build tools and package building tools dnf install -y \ gcc \ gcc-c++ \ make \ openssl-devel \ - pkg-config \ - rpm-build \ - rpmdevtools \ git \ - curl + curl \ + rpm-build \ + rpmdevtools + # Install runtime deps via make deps + make deps - name: Checkout repository uses: actions/checkout@v4 From cd5dbe8e947bbc2b0f49bdfd75e77704719bcbf2 Mon Sep 17 00:00:00 2001 From: Victor Wildner Date: Tue, 11 Nov 2025 00:06:51 +0100 Subject: [PATCH 4/8] fix: checkout first --- .github/workflows/release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ecd9343..cb6a163 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -163,6 +163,9 @@ jobs: container: image: fedora:latest steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Install build dependencies run: | # Install base build tools and package building tools @@ -178,9 +181,6 @@ jobs: # Install runtime deps via make deps make deps - - name: Checkout repository - uses: actions/checkout@v4 - - name: Setup Rust toolchain run: | curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \ From 1ea9ba16f982403f35c319acb7b08c13c73462ad Mon Sep 17 00:00:00 2001 From: Victor Wildner Date: Tue, 11 Nov 2025 00:16:33 +0100 Subject: [PATCH 5/8] fix(release): update runtime dependencies for Fedora - Replaced `make deps` with direct installation of runtime dependencies - Added installation of `openconnect`, `dbus-devel`, and `pkgconf-pkg-config` --- .github/workflows/release.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cb6a163..292e856 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -59,8 +59,11 @@ jobs: curl \ rpm-build \ rpmdevtools - # Install runtime deps via make deps - make deps + # Install runtime dependencies (openconnect + dbus) + dnf install -y \ + openconnect \ + dbus-devel \ + pkgconf-pkg-config - name: Setup Rust toolchain (Ubuntu) if: matrix.package == 'deb' @@ -178,8 +181,11 @@ jobs: curl \ rpm-build \ rpmdevtools - # Install runtime deps via make deps - make deps + # Install runtime dependencies (openconnect + dbus) + dnf install -y \ + openconnect \ + dbus-devel \ + pkgconf-pkg-config - name: Setup Rust toolchain run: | From cda421b87ad25012db7b7d2b321eddd040d590a4 Mon Sep 17 00:00:00 2001 From: Victor Wildner Date: Tue, 11 Nov 2025 00:23:27 +0100 Subject: [PATCH 6/8] fix(release): improve version handling in release pipeline - Added logic to set version based on GitHub event type - Use short SHA for PRs and branches - Maintain existing behavior for workflow dispatch and tags --- .github/workflows/release.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 292e856..4afb2b3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -148,8 +148,11 @@ jobs: run: | if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then echo "version=${{ inputs.version }}" >> $GITHUB_OUTPUT - else + elif [[ "$GITHUB_REF" == refs/tags/* ]]; then echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT + else + # For PRs and branches, use short SHA + echo "version=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_OUTPUT fi - name: Upload .deb artifact @@ -214,8 +217,11 @@ jobs: run: | if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then echo "version=${{ inputs.version }}" >> $GITHUB_OUTPUT - else + elif [[ "$GITHUB_REF" == refs/tags/* ]]; then echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT + else + # For PRs and branches, use short SHA + echo "version=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_OUTPUT fi - name: Upload .rpm artifact From bfd679826bc4c742681952e25ca0a956d81c008a Mon Sep 17 00:00:00 2001 From: Victor Wildner Date: Tue, 11 Nov 2025 00:30:59 +0100 Subject: [PATCH 7/8] fix(package): update version to 1.2.0 - Updated version in Cargo.toml for akon package - Updated version in Cargo.toml for akon-core package --- Cargo.toml | 2 +- akon-core/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index a363d6a..5ee2cf0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ resolver = "2" [package] name = "akon" -version = "1.1.1" +version = "1.2.0" edition = "2021" authors = ["vcwild"] description = "A CLI tool for managing VPN connections with OpenConnect" diff --git a/akon-core/Cargo.toml b/akon-core/Cargo.toml index c20f3d5..e55d04b 100644 --- a/akon-core/Cargo.toml +++ b/akon-core/Cargo.toml @@ -1,7 +1,7 @@ [package] edition = "2021" name = "akon-core" -version = "1.1.1" +version = "1.2.0" [features] default = [] From ecc130f6f1ddd363e10ae8cfe3ec420fc7a0e2e7 Mon Sep 17 00:00:00 2001 From: Victor Wildner Date: Tue, 11 Nov 2025 00:43:52 +0100 Subject: [PATCH 8/8] fix(release): extend retention days for release artifacts - Increased retention days for Debian packages from 90 to 120 - Increased retention days for RPM packages from 90 to 120 --- .github/workflows/release.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4afb2b3..a94992b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -160,10 +160,13 @@ jobs: with: name: akon-${{ steps.version.outputs.version }}-amd64.deb path: target/debian/*.deb - retention-days: 90 + retention-days: 120 # Build Fedora .rpm package build-rpm: + if: >- + startsWith(github.ref, 'refs/tags/') || + github.event_name == 'workflow_dispatch' name: Build Fedora .rpm Package runs-on: ubuntu-latest container: @@ -229,7 +232,7 @@ jobs: with: name: akon-${{ steps.version.outputs.version }}-1.x86_64.rpm path: target/generate-rpm/*.rpm - retention-days: 90 + retention-days: 120 # Create GitHub Release with packages create-release: