Skip to content

VERSION bump to 2.1.0 #34

VERSION bump to 2.1.0

VERSION bump to 2.1.0 #34

Workflow file for this run

name: Unified Package Release
on:
push:
paths:
- "VERSION"
branches:
- master
workflow_dispatch:
permissions:
contents: write
jobs:
# ============================================================================
# STEP 1: Prepare version info (no tag/release yet)
# ============================================================================
prepare-version:
name: Prepare Version Info
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
tag: ${{ steps.version.outputs.tag }}
release_msg: ${{ steps.version.outputs.release_msg }}
commit_sha: ${{ steps.commit.outputs.sha }}
steps:
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Get commit SHA
id: commit
run: |
echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
- name: Read version and find next available tag
id: version
run: |
base_ver=$(cat VERSION | tr -d '\n\r' | xargs)
git fetch --tags origin || true
counter=0
while true; do
if [ $counter -eq 0 ]; then
test_version="$base_ver"
test_tag="v$test_version"
else
test_version="$base_ver.$counter"
test_tag="v$test_version"
fi
if ! git tag -l "$test_tag" | grep -q "$test_tag" && ! git ls-remote --tags origin | grep -q "refs/tags/$test_tag"; then
final_version="$test_version"
final_tag="$test_tag"
break
fi
counter=$((counter + 1))
if [ $counter -gt 100 ]; then
echo "ERROR: Could not find available version after 100 attempts"
exit 1
fi
done
echo "Base version from file: $base_ver"
echo "Final version to use: $final_version"
echo "Final tag to create: $final_tag"
echo "version=$final_version" >> $GITHUB_OUTPUT
echo "tag=$final_tag" >> $GITHUB_OUTPUT
echo "release_msg=CoolerDash $final_tag" >> $GITHUB_OUTPUT
# ============================================================================
# STEP 2: Build all packages FIRST (before creating tag/release)
# ============================================================================
build-packages:
name: Build ${{ matrix.distro }} Package
runs-on: ubuntu-latest
needs: prepare-version
strategy:
fail-fast: false
matrix:
include:
- distro: ubuntu:24.04
type: deb
name: debian-based
pkg_name: coolerdash_${{ needs.prepare-version.outputs.version }}_amd64.deb
- distro: fedora:42
type: rpm
name: fedora-42
pkg_name: coolerdash-${{ needs.prepare-version.outputs.version }}-1.fc42.x86_64.rpm
- distro: quay.io/centos/centos:stream9
type: rpm
name: centos-stream9
pkg_name: coolerdash-${{ needs.prepare-version.outputs.version }}-1.el9.x86_64.rpm
- distro: opensuse/tumbleweed
type: rpm
name: opensuse-tumbleweed
pkg_name: coolerdash-${{ needs.prepare-version.outputs.version }}-1.opensuse.x86_64.rpm
container:
image: ${{ matrix.distro }}
steps:
- name: Install build dependencies (Debian/Ubuntu)
if: matrix.type == 'deb'
run: |
apt-get update
apt-get install -y \
build-essential \
debhelper \
pkg-config \
libcairo2-dev \
libcurl4-openssl-dev \
libjansson-dev \
fonts-roboto \
systemd \
file \
gnupg2 \
git
- name: Install build dependencies (Fedora)
if: matrix.name == 'fedora-42'
run: |
dnf install -y \
rpm-build \
rpmdevtools \
gcc \
make \
pkg-config \
cairo-devel \
libcurl-devel \
jansson-devel \
google-roboto-fonts \
systemd \
file \
rpm-sign \
gnupg2 \
git
- name: Install build dependencies (CentOS Stream)
if: matrix.name == 'centos-stream9'
run: |
dnf update -y
dnf install -y epel-release
dnf config-manager --set-enabled crb
dnf makecache
dnf install -y \
rpm-build \
rpmdevtools \
gcc \
make \
pkg-config \
cairo-devel \
libcurl-devel \
jansson-devel \
google-roboto-fonts \
systemd \
file \
rpm-sign \
gnupg2 \
git
- name: Install build dependencies (openSUSE)
if: matrix.name == 'opensuse-tumbleweed'
run: |
zypper install -y \
tar \
rpm-build \
rpmdevtools \
gcc \
make \
pkg-config \
cairo-devel \
libcurl-devel \
libjansson-devel \
google-roboto-fonts \
systemd \
file \
gpg2 \
git
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
ref: master
fetch-depth: 0
- name: Copy packaging files to root
run: |
if [ "${{ matrix.type }}" = "deb" ]; then
cp -r packaging/debian ./
fi
if [ "${{ matrix.type }}" = "rpm" ]; then
cp packaging/coolerdash.spec ./
fi
- name: Prepare version for changelog
id: prep
run: |
VERSION="${{ needs.prepare-version.outputs.version }}"
DATE=$(date -R)
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "date=$DATE" >> $GITHUB_OUTPUT
- name: Build DEB package
if: matrix.type == 'deb'
run: |
sed -i "s/{{VERSION}}/${{ steps.prep.outputs.version }}/g" debian/changelog
sed -i "s/{{DATE}}/${{ steps.prep.outputs.date }}/g" debian/changelog
dpkg-buildpackage -us -uc -b
mv ../*.deb ./
ls -lh *.deb
- name: Build RPM package
if: matrix.type == 'rpm'
env:
COOLERDASH_VERSION: ${{ needs.prepare-version.outputs.version }}
run: |
if [ "${{ matrix.name }}" = "opensuse-tumbleweed" ]; then
RPMBUILD_DIR="/usr/src/packages"
else
RPMBUILD_DIR="$HOME/rpmbuild"
fi
mkdir -p $RPMBUILD_DIR/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
mkdir -p /tmp/coolerdash-${COOLERDASH_VERSION}
cp -r . /tmp/coolerdash-${COOLERDASH_VERSION}/ 2>/dev/null || true
tar czf $RPMBUILD_DIR/SOURCES/coolerdash-${COOLERDASH_VERSION}.tar.gz -C /tmp coolerdash-${COOLERDASH_VERSION}
cp coolerdash.spec $RPMBUILD_DIR/SPECS/ 2>/dev/null || true
rpmbuild -bb $RPMBUILD_DIR/SPECS/coolerdash.spec
find $RPMBUILD_DIR/RPMS -name "*.rpm" -exec cp {} ./ \;
ls -lh *.rpm
- name: Verify package
run: |
if [ "${{ matrix.type }}" = "deb" ]; then
dpkg --info *.deb
else
rpm -qpi *.rpm
fi
- name: Rename package
run: |
mv *.deb ${{ matrix.pkg_name }} 2>/dev/null || true
mv *.rpm ${{ matrix.pkg_name }} 2>/dev/null || true
ls -lh ${{ matrix.pkg_name }}
- name: Upload package artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.name }}-package
path: ${{ matrix.pkg_name }}
retention-days: 7
# ============================================================================
# STEP 3: Create Tag & Release ONLY after all builds succeed
# ============================================================================
create-release:
name: Create Tag & Release
runs-on: ubuntu-latest
needs: [prepare-version, build-packages]
if: github.ref == 'refs/heads/master'
steps:
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install GPG tools
run: |
sudo apt-get update -y
sudo apt-get install -y gnupg2 pinentry-curses
export GNUPGHOME=$(mktemp -d)
chmod 700 "$GNUPGHOME"
echo "allow-loopback-pinentry" > "$GNUPGHOME/gpg-agent.conf"
echo "use-agent" > "$GNUPGHOME/gpg.conf"
echo "pinentry-program /usr/bin/pinentry-curses" >> "$GNUPGHOME/gpg-agent.conf"
echo "GNUPGHOME=$GNUPGHOME" >> $GITHUB_ENV
- name: Import GPG key
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
run: |
gpgconf --kill gpg-agent || true
echo "$GPG_PRIVATE_KEY" | gpg --batch --import
echo -e "5\ny\n" | gpg --batch --command-fd 0 --expert --edit-key $(gpg --list-secret-keys --with-colons | awk -F: '/^sec/ {print $5; exit}') trust quit || true
- name: Get GPG key ID
id: gpg
run: |
KEYID=$(gpg --list-secret-keys --with-colons | awk -F: '/^sec/ {print $5; exit}')
echo "keyid=$KEYID" >> $GITHUB_OUTPUT
- name: Configure git for GPG signing
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config user.signingkey "${{ steps.gpg.outputs.keyid }}"
git config commit.gpgSign true
git config tag.gpgSign true
git config gpg.program gpg
- name: Create and Push signed tag
env:
TAG: ${{ needs.prepare-version.outputs.tag }}
MSG: ${{ needs.prepare-version.outputs.release_msg }}
run: |
echo "✅ All builds succeeded! Creating signed tag: $TAG"
git tag -s "$TAG" -m "$MSG" HEAD
git push origin "$TAG"
- name: Create GitHub Release
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844
with:
tag_name: ${{ needs.prepare-version.outputs.tag }}
name: ${{ needs.prepare-version.outputs.release_msg }}
draft: false
prerelease: false
generate_release_notes: true
body: |
### Changes:
- Version updated to ${{ needs.prepare-version.outputs.version }}
---
## AUR Package
[![AUR](https://img.shields.io/aur/version/coolerdash-git?color=blue&label=AUR)](https://aur.archlinux.org/packages/coolerdash-git)
### Installation:
```bash
# Using an AUR helper
yay -S coolerdash-git
# OR any other AUR helper
```
---
## Binary Packages
### Ubuntu / Debian
```bash
sudo apt install ./coolerdash_${{ needs.prepare-version.outputs.version }}_amd64.deb
```
### Fedora
```bash
sudo dnf install ./coolerdash-${{ needs.prepare-version.outputs.version }}-1.fc42.x86_64.rpm
```
### CentOS / RHEL
```bash
sudo dnf install ./coolerdash-${{ needs.prepare-version.outputs.version }}-1.el9.x86_64.rpm
```
### openSUSE
```bash
sudo zypper install ./coolerdash-${{ needs.prepare-version.outputs.version }}-1.opensuse.x86_64.rpm
```
---
## 🔐 GPG Verification
```bash
wget https://github.com/${{ github.repository }}/releases/download/${{ needs.prepare-version.outputs.tag }}/SHA256SUMS.asc
gpg --verify SHA256SUMS.asc
```
---
## Manual Installation
```bash
# STEP 1: Clone repository
git clone https://github.com/damachine/coolerdash.git
cd coolerdash
# STEP 2: Build and install (auto-detects Linux distribution and installs dependencies)
make install
```
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Cleanup GPG
if: always()
run: |
if [ -n "$GNUPGHOME" ] && [ -d "$GNUPGHOME" ]; then
gpgconf --kill gpg-agent || true
rm -rf "$GNUPGHOME"
fi
# ============================================================================
# STEP 4: Upload packages to the release
# ============================================================================
upload-packages:
name: Upload Packages to Release
runs-on: ubuntu-latest
needs: [prepare-version, build-packages, create-release]
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: packages
- name: List downloaded packages
run: |
find packages -type f
ls -lhR packages/
- name: Generate SHA256SUMS
run: |
cd packages
find . -type f \( -name "*.deb" -o -name "*.rpm" \) -exec sha256sum {} \; | sed 's|\./[^/]*/||' > ../SHA256SUMS
cd ..
cat SHA256SUMS
- name: Import GPG key for checksums
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
run: |
export GNUPGHOME=$(mktemp -d)
chmod 700 "$GNUPGHOME"
echo "allow-loopback-pinentry" > "$GNUPGHOME/gpg-agent.conf"
echo "pinentry-program /usr/bin/pinentry-curses" >> "$GNUPGHOME/gpg-agent.conf"
echo "$GPG_PRIVATE_KEY" | gpg --batch --import
echo "GNUPGHOME=$GNUPGHOME" >> $GITHUB_ENV
- name: Sign SHA256SUMS
run: |
gpg --batch --pinentry-mode loopback --detach-sign --armor SHA256SUMS
ls -lh SHA256SUMS*
- name: Upload packages to release
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844
with:
tag_name: ${{ needs.prepare-version.outputs.tag }}
files: |
packages/**/*.deb
packages/**/*.rpm
SHA256SUMS
SHA256SUMS.asc
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# ============================================================================
# STEP 5: Update AUR repository
# ============================================================================
aur-push:
name: Update AUR Repository
runs-on: ubuntu-latest
needs: [prepare-version, create-release]
if: github.ref == 'refs/heads/master'
steps:
- name: Checkout main repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
fetch-depth: 0
- name: Prepare PKGBUILD with updated commit hash from tag
run: |
TAG="${{ needs.prepare-version.outputs.tag }}"
VERSION="${{ needs.prepare-version.outputs.version }}"
# Fetch tags and get commit hash from the newly created tag
git fetch --tags
COMMIT_SHA=$(git rev-list -n 1 "$TAG")
# Calculate pkgver from the tag (simulate pkgver() function in PKGBUILD)
# This mimics: git describe --tags --long --match "v*" | sed -E 's/^v//; s/-([0-9]+)-g/\.r\1.g/; s/-/./g'
PKGVER=$(git describe --tags --long --match "v*" "$COMMIT_SHA" | sed -E 's/^v//; s/-([0-9]+)-g/\.r\1.g/; s/-/./g')
echo "✅ Tag: $TAG"
echo "✅ Commit SHA from tag: $COMMIT_SHA"
echo "✅ Version: $VERSION"
echo "✅ Calculated PKGVER: $PKGVER"
# Prepare AUR deployment directory
mkdir -p $GITHUB_WORKSPACE/aur-deploy
cp aur/PKGBUILD $GITHUB_WORKSPACE/aur-deploy/PKGBUILD
cp aur/coolerdash.install $GITHUB_WORKSPACE/aur-deploy/coolerdash.install
# Update PKGBUILD with new commit hash, pkgver and reset pkgrel
sed -i "s/^pkgver=.*/pkgver=$PKGVER/" $GITHUB_WORKSPACE/aur-deploy/PKGBUILD
sed -i "s/^_commit=.*/_commit=$COMMIT_SHA/" $GITHUB_WORKSPACE/aur-deploy/PKGBUILD
sed -i "s/^pkgrel=.*/pkgrel=1/" $GITHUB_WORKSPACE/aur-deploy/PKGBUILD
echo "✅ Updated PKGBUILD:"
grep -E "^pkgver=|^_commit=|^pkgrel=" $GITHUB_WORKSPACE/aur-deploy/PKGBUILD
- name: Deploy to AUR
uses: KSXGitHub/github-actions-deploy-aur@v3
with:
pkgname: coolerdash-git
pkgbuild: ./aur-deploy/PKGBUILD
assets: |
./aur-deploy/coolerdash.install
commit_username: "github-actions[bot]"
commit_email: "41898282+github-actions[bot]@users.noreply.github.com"
commit_message: "Update to ${{ needs.prepare-version.outputs.tag }}"
ssh_private_key: ${{ secrets.AUR_SSH_KEY }}
allow_empty_commits: false
force_push: false
# ============================================================================
# STEP 6: Summary
# ============================================================================
release-summary:
name: Release Summary
runs-on: ubuntu-latest
needs:
[
prepare-version,
build-packages,
create-release,
upload-packages,
aur-push,
]
if: always()
steps:
- name: Create summary report
run: |
echo "## 🚀 CoolerDash Release Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Release Details:" >> $GITHUB_STEP_SUMMARY
echo "- **Version**: ${{ needs.prepare-version.outputs.version }}" >> $GITHUB_STEP_SUMMARY
echo "- **Tag**: ${{ needs.prepare-version.outputs.tag }}" >> $GITHUB_STEP_SUMMARY
echo "- **Commit**: ${{ needs.prepare-version.outputs.commit_sha }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Build Status:" >> $GITHUB_STEP_SUMMARY
echo "- **Package Builds**: ${{ needs.build-packages.result }}" >> $GITHUB_STEP_SUMMARY
echo "- **Release Creation**: ${{ needs.create-release.result }}" >> $GITHUB_STEP_SUMMARY
echo "- **Package Upload**: ${{ needs.upload-packages.result }}" >> $GITHUB_STEP_SUMMARY
echo "- **AUR Update**: ${{ needs.aur-push.result }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### 📥 Downloads:" >> $GITHUB_STEP_SUMMARY
echo "https://github.com/${{ github.repository }}/releases/tag/${{ needs.prepare-version.outputs.tag }}" >> $GITHUB_STEP_SUMMARY