Skip to content

Commit 957b614

Browse files
committed
ci: auto-tag and release on main push
Adds an 'auto-tag' job to deploy.yml that: - Reads the current version - Increments the patch version - Updates tauri.conf.json, package.json, and AUR packaging files - Commits and pushes a new git tag to trigger the release workflow This completely automates the release and packaging cycle for every push to main.
1 parent 5bf2f2f commit 957b614

5 files changed

Lines changed: 112 additions & 14 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,3 +123,77 @@ jobs:
123123
done
124124
echo "Health check failed after 6 attempts"
125125
exit 1
126+
127+
auto-tag:
128+
name: Auto Tag & Release
129+
needs: deploy
130+
if: "github.ref == 'refs/heads/main' && !contains(github.event.head_commit.message, '[skip ci]')"
131+
runs-on: ubuntu-latest
132+
permissions:
133+
contents: write
134+
steps:
135+
- uses: actions/checkout@v4
136+
with:
137+
token: ${{ secrets.PAT_TOKEN || secrets.GITHUB_TOKEN }}
138+
fetch-depth: 0
139+
140+
- name: Setup Node
141+
uses: actions/setup-node@v4
142+
with:
143+
node-version: 22
144+
145+
- name: Bump version and push tag
146+
run: |
147+
TAURI_VER=$(node -p "require('./apps/desktop/src-tauri/tauri.conf.json').version")
148+
NPM_VER=$(node -p "require('./packages/openlinear/package.json').version")
149+
150+
get_latest_version() {
151+
local v1=$1
152+
local v2=$2
153+
if [ "$(printf '%s\n' "$v1" "$v2" | sort -V | tail -n1)" = "$v1" ]; then
154+
echo "$v1"
155+
else
156+
echo "$v2"
157+
fi
158+
}
159+
160+
HIGHEST=$(get_latest_version "$TAURI_VER" "$NPM_VER")
161+
IFS='.' read -ra ADDR <<< "$HIGHEST"
162+
MAJOR="${ADDR[0]}"
163+
MINOR="${ADDR[1]}"
164+
PATCH="${ADDR[2]}"
165+
NEW_PATCH=$((PATCH + 1))
166+
NEW_VERSION="$MAJOR.$MINOR.$NEW_PATCH"
167+
168+
echo "Bumping from $HIGHEST to $NEW_VERSION"
169+
170+
node -e "
171+
const fs = require('fs');
172+
const p = './packages/openlinear/package.json';
173+
const data = JSON.parse(fs.readFileSync(p));
174+
data.version = '$NEW_VERSION';
175+
fs.writeFileSync(p, JSON.stringify(data, null, 2) + '\n');
176+
"
177+
178+
node -e "
179+
const fs = require('fs');
180+
const p = './apps/desktop/src-tauri/tauri.conf.json';
181+
const data = JSON.parse(fs.readFileSync(p));
182+
data.version = '$NEW_VERSION';
183+
fs.writeFileSync(p, JSON.stringify(data, null, 2) + '\n');
184+
"
185+
186+
sed -i "s/^pkgver=.*/pkgver=$NEW_VERSION/" packaging/aur/openlinear-bin/PKGBUILD
187+
sed -i "s/pkgver = .*/pkgver = $NEW_VERSION/" packaging/aur/openlinear-bin/.SRCINFO
188+
sed -i "s/v$HIGHEST/v$NEW_VERSION/g" packaging/aur/openlinear-bin/.SRCINFO
189+
sed -i "s/openlinear-$HIGHEST/openlinear-$NEW_VERSION/g" packaging/aur/openlinear-bin/.SRCINFO
190+
191+
git config --global user.name "github-actions[bot]"
192+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
193+
194+
git add apps/desktop/src-tauri/tauri.conf.json packages/openlinear/package.json packaging/aur/openlinear-bin/PKGBUILD packaging/aur/openlinear-bin/.SRCINFO
195+
git commit -m "chore(release): v$NEW_VERSION [skip ci]"
196+
git tag "v$NEW_VERSION"
197+
198+
git push origin main
199+
git push origin "v$NEW_VERSION"
Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://schema.tauri.app/config/2",
33
"productName": "OpenLinear",
4-
"version": "0.1.14",
4+
"version": "0.1.23",
55
"identifier": "com.openlinear.app",
66
"build": {
77
"beforeDevCommand": "PORT=3000 pnpm --filter @openlinear/desktop-ui dev",
@@ -10,7 +10,9 @@
1010
"frontendDist": "../../desktop-ui/out"
1111
},
1212
"app": {
13-
"security": { "csp": null },
13+
"security": {
14+
"csp": null
15+
},
1416
"windows": [
1517
{
1618
"title": "OpenLinear",
@@ -23,21 +25,43 @@
2325
},
2426
"bundle": {
2527
"active": true,
26-
"targets": ["dmg", "app", "appimage", "deb"],
27-
"icon": ["icons/icon.png"],
28+
"targets": [
29+
"dmg",
30+
"app",
31+
"appimage",
32+
"deb"
33+
],
34+
"icon": [
35+
"icons/icon.png"
36+
],
2837
"macOS": {
2938
"minimumSystemVersion": "10.15",
3039
"dmg": {
31-
"windowSize": { "width": 540, "height": 400 }
40+
"windowSize": {
41+
"width": 540,
42+
"height": 400
43+
}
3244
}
3345
},
3446
"linux": {
35-
"appimage": { "bundleMediaFramework": false },
36-
"deb": { "depends": [] }
47+
"appimage": {
48+
"bundleMediaFramework": false
49+
},
50+
"deb": {
51+
"depends": []
52+
}
3753
}
3854
},
3955
"plugins": {
40-
"shell": { "open": true },
41-
"deep-link": { "desktop": { "schemes": ["openlinear"] } }
56+
"shell": {
57+
"open": true
58+
},
59+
"deep-link": {
60+
"desktop": {
61+
"schemes": [
62+
"openlinear"
63+
]
64+
}
65+
}
4266
}
4367
}

packages/openlinear/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "openlinear",
3-
"version": "0.1.22",
3+
"version": "0.1.23",
44
"description": "OpenLinear launcher, installer, and validation utilities",
55
"license": "MIT",
66
"repository": {

packaging/aur/openlinear-bin/.SRCINFO

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
pkgbase = openlinear-bin
22
pkgdesc = AI-powered project management that actually writes the code — desktop app
3-
pkgver = 0.1.14
3+
pkgver = 0.1.23
44
pkgrel = 1
55
url = https://github.com/kaizen403/openlinear
66
arch = x86_64
@@ -12,9 +12,9 @@ pkgbase = openlinear-bin
1212
optdepends = xdg-utils: open links in browser
1313
provides = openlinear
1414
conflicts = openlinear
15-
source = openlinear-0.1.14-x86_64.AppImage::https://github.com/kaizen403/openlinear/releases/download/v0.1.14/openlinear-0.1.14-x86_64.AppImage
15+
source = openlinear-0.1.23-x86_64.AppImage::https://github.com/kaizen403/openlinear/releases/download/v0.1.23/openlinear-0.1.23-x86_64.AppImage
1616
source = openlinear.desktop
17-
source = openlinear.png::https://raw.githubusercontent.com/kaizen403/openlinear/v0.1.14/apps/desktop/src-tauri/icons/icon.png
17+
source = openlinear.png::https://raw.githubusercontent.com/kaizen403/openlinear/v0.1.23/apps/desktop/src-tauri/icons/icon.png
1818
sha256sums = SKIP
1919
sha256sums = SKIP
2020
sha256sums = SKIP

packaging/aur/openlinear-bin/PKGBUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Maintainer: kaizen403 <kaizen403@proton.me>
22
pkgname=openlinear-bin
3-
pkgver=0.1.14
3+
pkgver=0.1.23
44
pkgrel=1
55
pkgdesc="AI-powered project management that actually writes the code — desktop app"
66
arch=('x86_64')

0 commit comments

Comments
 (0)