Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9033881274 | ||
|
|
1ed34e0bbb | ||
|
|
b7a00af2e0 |
@@ -2,10 +2,7 @@ name: Build Linux
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
|
||||||
tags: ["v*"]
|
tags: ["v*"]
|
||||||
pull_request:
|
|
||||||
branches: [main]
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
PYTHON_VERSION: "3.11"
|
PYTHON_VERSION: "3.11"
|
||||||
@@ -66,34 +63,33 @@ jobs:
|
|||||||
|
|
||||||
# ── Release ──
|
# ── Release ──
|
||||||
- name: Upload to release
|
- name: Upload to release
|
||||||
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
|
|
||||||
env:
|
env:
|
||||||
BUILD_TOKEN: ${{ secrets.BUILD_TOKEN }}
|
BUILD_TOKEN: ${{ secrets.BUILD_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get install -y jq
|
sudo apt-get install -y jq
|
||||||
REPO_API="${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}"
|
REPO_API="${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}"
|
||||||
|
|
||||||
# Use version tag for tag pushes, "latest" for main
|
TAG="${GITHUB_REF_NAME}"
|
||||||
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then
|
RELEASE_NAME="Voice to Notes ${TAG}"
|
||||||
TAG="${GITHUB_REF#refs/tags/}"
|
|
||||||
RELEASE_NAME="Voice to Notes ${TAG}"
|
|
||||||
PRERELEASE=false
|
|
||||||
else
|
|
||||||
TAG="latest"
|
|
||||||
RELEASE_NAME="Voice to Notes (Latest Build)"
|
|
||||||
PRERELEASE=true
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Release tag: ${TAG}"
|
echo "Release tag: ${TAG}"
|
||||||
|
|
||||||
RELEASE_ID=$(curl -s -H "Authorization: token ${BUILD_TOKEN}" \
|
# Wait for release to be created by the release workflow
|
||||||
"${REPO_API}/releases/tags/${TAG}" | jq -r '.id // empty')
|
for i in 1 2 3 4 5; do
|
||||||
|
RELEASE_ID=$(curl -s -H "Authorization: token ${BUILD_TOKEN}" \
|
||||||
|
"${REPO_API}/releases/tags/${TAG}" | jq -r '.id // empty')
|
||||||
|
if [ -n "${RELEASE_ID}" ] && [ "${RELEASE_ID}" != "null" ]; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
echo "Release not found yet, waiting 10s... (attempt $i)"
|
||||||
|
sleep 10
|
||||||
|
done
|
||||||
|
|
||||||
if [ -z "${RELEASE_ID}" ]; then
|
# Fallback: create release if it still doesn't exist
|
||||||
|
if [ -z "${RELEASE_ID}" ] || [ "${RELEASE_ID}" = "null" ]; then
|
||||||
RELEASE_ID=$(curl -s -X POST \
|
RELEASE_ID=$(curl -s -X POST \
|
||||||
-H "Authorization: token ${BUILD_TOKEN}" \
|
-H "Authorization: token ${BUILD_TOKEN}" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d "{\"tag_name\": \"${TAG}\", \"name\": \"${RELEASE_NAME}\", \"body\": \"Automated build.\", \"draft\": false, \"prerelease\": ${PRERELEASE}}" \
|
-d "{\"tag_name\": \"${TAG}\", \"name\": \"${RELEASE_NAME}\", \"body\": \"Automated build.\", \"draft\": false, \"prerelease\": false}" \
|
||||||
"${REPO_API}/releases" | jq -r '.id')
|
"${REPO_API}/releases" | jq -r '.id')
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -2,10 +2,7 @@ name: Build macOS
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
|
||||||
tags: ["v*"]
|
tags: ["v*"]
|
||||||
pull_request:
|
|
||||||
branches: [main]
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
PYTHON_VERSION: "3.11"
|
PYTHON_VERSION: "3.11"
|
||||||
@@ -65,33 +62,35 @@ jobs:
|
|||||||
|
|
||||||
# ── Release ──
|
# ── Release ──
|
||||||
- name: Upload to release
|
- name: Upload to release
|
||||||
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
|
|
||||||
env:
|
env:
|
||||||
BUILD_TOKEN: ${{ secrets.BUILD_TOKEN }}
|
BUILD_TOKEN: ${{ secrets.BUILD_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
|
# Ensure jq is available
|
||||||
|
which jq || brew install jq
|
||||||
|
|
||||||
REPO_API="${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}"
|
REPO_API="${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}"
|
||||||
|
|
||||||
# Use version tag for tag pushes, "latest" for main
|
TAG="${GITHUB_REF_NAME}"
|
||||||
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then
|
RELEASE_NAME="Voice to Notes ${TAG}"
|
||||||
TAG="${GITHUB_REF#refs/tags/}"
|
|
||||||
RELEASE_NAME="Voice to Notes ${TAG}"
|
|
||||||
PRERELEASE=false
|
|
||||||
else
|
|
||||||
TAG="latest"
|
|
||||||
RELEASE_NAME="Voice to Notes (Latest Build)"
|
|
||||||
PRERELEASE=true
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Release tag: ${TAG}"
|
echo "Release tag: ${TAG}"
|
||||||
|
|
||||||
RELEASE_ID=$(curl -s -H "Authorization: token ${BUILD_TOKEN}" \
|
# Wait for release to be created by the release workflow
|
||||||
"${REPO_API}/releases/tags/${TAG}" | jq -r '.id // empty')
|
for i in 1 2 3 4 5; do
|
||||||
|
RELEASE_ID=$(curl -s -H "Authorization: token ${BUILD_TOKEN}" \
|
||||||
|
"${REPO_API}/releases/tags/${TAG}" | jq -r '.id // empty')
|
||||||
|
if [ -n "${RELEASE_ID}" ] && [ "${RELEASE_ID}" != "null" ]; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
echo "Release not found yet, waiting 10s... (attempt $i)"
|
||||||
|
sleep 10
|
||||||
|
done
|
||||||
|
|
||||||
if [ -z "${RELEASE_ID}" ]; then
|
# Fallback: create release if it still doesn't exist
|
||||||
|
if [ -z "${RELEASE_ID}" ] || [ "${RELEASE_ID}" = "null" ]; then
|
||||||
RELEASE_ID=$(curl -s -X POST \
|
RELEASE_ID=$(curl -s -X POST \
|
||||||
-H "Authorization: token ${BUILD_TOKEN}" \
|
-H "Authorization: token ${BUILD_TOKEN}" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d "{\"tag_name\": \"${TAG}\", \"name\": \"${RELEASE_NAME}\", \"body\": \"Automated build.\", \"draft\": false, \"prerelease\": ${PRERELEASE}}" \
|
-d "{\"tag_name\": \"${TAG}\", \"name\": \"${RELEASE_NAME}\", \"body\": \"Automated build.\", \"draft\": false, \"prerelease\": false}" \
|
||||||
"${REPO_API}/releases" | jq -r '.id')
|
"${REPO_API}/releases" | jq -r '.id')
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -2,10 +2,7 @@ name: Build Windows
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
|
||||||
tags: ["v*"]
|
tags: ["v*"]
|
||||||
pull_request:
|
|
||||||
branches: [main]
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
PYTHON_VERSION: "3.11"
|
PYTHON_VERSION: "3.11"
|
||||||
@@ -75,7 +72,6 @@ jobs:
|
|||||||
|
|
||||||
# ── Release ──
|
# ── Release ──
|
||||||
- name: Upload to release
|
- name: Upload to release
|
||||||
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
|
|
||||||
shell: powershell
|
shell: powershell
|
||||||
env:
|
env:
|
||||||
BUILD_TOKEN: ${{ secrets.BUILD_TOKEN }}
|
BUILD_TOKEN: ${{ secrets.BUILD_TOKEN }}
|
||||||
@@ -83,30 +79,31 @@ jobs:
|
|||||||
$REPO_API = "${{ github.server_url }}/api/v1/repos/${{ github.repository }}"
|
$REPO_API = "${{ github.server_url }}/api/v1/repos/${{ github.repository }}"
|
||||||
$Headers = @{ "Authorization" = "token $env:BUILD_TOKEN" }
|
$Headers = @{ "Authorization" = "token $env:BUILD_TOKEN" }
|
||||||
|
|
||||||
# Use version tag for tag pushes, "latest" for main
|
$TAG = "${{ github.ref_name }}"
|
||||||
$REF = "${{ github.ref }}"
|
$RELEASE_NAME = "Voice to Notes ${TAG}"
|
||||||
if ($REF.StartsWith("refs/tags/")) {
|
|
||||||
$TAG = $REF.Replace("refs/tags/", "")
|
|
||||||
$RELEASE_NAME = "Voice to Notes ${TAG}"
|
|
||||||
$PRERELEASE = $false
|
|
||||||
} else {
|
|
||||||
$TAG = "latest"
|
|
||||||
$RELEASE_NAME = "Voice to Notes (Latest Build)"
|
|
||||||
$PRERELEASE = $true
|
|
||||||
}
|
|
||||||
|
|
||||||
Write-Host "Release tag: ${TAG}"
|
Write-Host "Release tag: ${TAG}"
|
||||||
|
|
||||||
try {
|
# Wait for release to be created by the release workflow
|
||||||
$release = Invoke-RestMethod -Uri "${REPO_API}/releases/tags/${TAG}" -Headers $Headers -ErrorAction Stop
|
$RELEASE_ID = $null
|
||||||
$RELEASE_ID = $release.id
|
for ($i = 1; $i -le 5; $i++) {
|
||||||
} catch {
|
try {
|
||||||
|
$release = Invoke-RestMethod -Uri "${REPO_API}/releases/tags/${TAG}" -Headers $Headers -ErrorAction Stop
|
||||||
|
$RELEASE_ID = $release.id
|
||||||
|
break
|
||||||
|
} catch {
|
||||||
|
Write-Host "Release not found yet, waiting 10s... (attempt $i)"
|
||||||
|
Start-Sleep -Seconds 10
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Fallback: create release if it still doesn't exist
|
||||||
|
if (-not $RELEASE_ID) {
|
||||||
$body = @{
|
$body = @{
|
||||||
tag_name = $TAG
|
tag_name = $TAG
|
||||||
name = $RELEASE_NAME
|
name = $RELEASE_NAME
|
||||||
body = "Automated build."
|
body = "Automated build."
|
||||||
draft = $false
|
draft = $false
|
||||||
prerelease = $PRERELEASE
|
prerelease = $false
|
||||||
} | ConvertTo-Json
|
} | ConvertTo-Json
|
||||||
$release = Invoke-RestMethod -Uri "${REPO_API}/releases" -Method Post -Headers $Headers -ContentType "application/json" -Body $body
|
$release = Invoke-RestMethod -Uri "${REPO_API}/releases" -Method Post -Headers $Headers -ContentType "application/json" -Body $body
|
||||||
$RELEASE_ID = $release.id
|
$RELEASE_ID = $release.id
|
||||||
|
|||||||
77
.gitea/workflows/release.yml
Normal file
77
.gitea/workflows/release.yml
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
name: Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
bump-version:
|
||||||
|
name: Bump version and tag
|
||||||
|
# Skip if this is a version-bump commit (avoid infinite loop)
|
||||||
|
if: "!contains(github.event.head_commit.message, '[skip ci]')"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Configure git
|
||||||
|
run: |
|
||||||
|
git config user.name "Gitea Actions"
|
||||||
|
git config user.email "actions@gitea.local"
|
||||||
|
|
||||||
|
- name: Bump patch version
|
||||||
|
run: |
|
||||||
|
# Read current version from package.json
|
||||||
|
CURRENT=$(grep '"version"' package.json | head -1 | sed 's/.*"version": *"\([^"]*\)".*/\1/')
|
||||||
|
echo "Current version: ${CURRENT}"
|
||||||
|
|
||||||
|
# Increment patch number
|
||||||
|
MAJOR=$(echo "${CURRENT}" | cut -d. -f1)
|
||||||
|
MINOR=$(echo "${CURRENT}" | cut -d. -f2)
|
||||||
|
PATCH=$(echo "${CURRENT}" | cut -d. -f3)
|
||||||
|
NEW_PATCH=$((PATCH + 1))
|
||||||
|
NEW_VERSION="${MAJOR}.${MINOR}.${NEW_PATCH}"
|
||||||
|
echo "New version: ${NEW_VERSION}"
|
||||||
|
|
||||||
|
# Update package.json
|
||||||
|
sed -i "s/\"version\": \"${CURRENT}\"/\"version\": \"${NEW_VERSION}\"/" package.json
|
||||||
|
|
||||||
|
# Update src-tauri/tauri.conf.json
|
||||||
|
sed -i "s/\"version\": \"${CURRENT}\"/\"version\": \"${NEW_VERSION}\"/" src-tauri/tauri.conf.json
|
||||||
|
|
||||||
|
# Update src-tauri/Cargo.toml (match version = "x.y.z" in [package] section)
|
||||||
|
sed -i "s/^version = \"${CURRENT}\"/version = \"${NEW_VERSION}\"/" src-tauri/Cargo.toml
|
||||||
|
|
||||||
|
# Update python/pyproject.toml
|
||||||
|
sed -i "s/^version = \".*\"/version = \"${NEW_VERSION}\"/" python/pyproject.toml
|
||||||
|
|
||||||
|
echo "NEW_VERSION=${NEW_VERSION}" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Commit and tag
|
||||||
|
env:
|
||||||
|
BUILD_TOKEN: ${{ secrets.BUILD_TOKEN }}
|
||||||
|
run: |
|
||||||
|
git add package.json src-tauri/tauri.conf.json src-tauri/Cargo.toml python/pyproject.toml
|
||||||
|
git commit -m "chore: bump version to ${NEW_VERSION} [skip ci]"
|
||||||
|
git tag "v${NEW_VERSION}"
|
||||||
|
|
||||||
|
# Push using token for authentication
|
||||||
|
REMOTE_URL=$(git remote get-url origin | sed "s|://|://gitea-actions:${BUILD_TOKEN}@|")
|
||||||
|
git push "${REMOTE_URL}" HEAD:main
|
||||||
|
git push "${REMOTE_URL}" "v${NEW_VERSION}"
|
||||||
|
|
||||||
|
- name: Create Gitea release
|
||||||
|
env:
|
||||||
|
BUILD_TOKEN: ${{ secrets.BUILD_TOKEN }}
|
||||||
|
run: |
|
||||||
|
REPO_API="${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}"
|
||||||
|
TAG="v${NEW_VERSION}"
|
||||||
|
RELEASE_NAME="Voice to Notes ${TAG}"
|
||||||
|
|
||||||
|
curl -s -X POST \
|
||||||
|
-H "Authorization: token ${BUILD_TOKEN}" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d "{\"tag_name\": \"${TAG}\", \"name\": \"${RELEASE_NAME}\", \"body\": \"Automated build.\", \"draft\": false, \"prerelease\": false}" \
|
||||||
|
"${REPO_API}/releases"
|
||||||
|
echo "Created release: ${RELEASE_NAME}"
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "voice-to-notes",
|
"name": "voice-to-notes",
|
||||||
"version": "0.2.0",
|
"version": "0.2.1",
|
||||||
"description": "Desktop app for transcribing audio/video with speaker identification",
|
"description": "Desktop app for transcribing audio/video with speaker identification",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "voice-to-notes"
|
name = "voice-to-notes"
|
||||||
version = "0.1.0"
|
version = "0.2.1"
|
||||||
description = "Python sidecar for Voice to Notes — transcription, diarization, and AI services"
|
description = "Python sidecar for Voice to Notes — transcription, diarization, and AI services"
|
||||||
requires-python = ">=3.11"
|
requires-python = ">=3.11"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "voice-to-notes"
|
name = "voice-to-notes"
|
||||||
version = "0.2.0"
|
version = "0.2.1"
|
||||||
description = "Voice to Notes — desktop transcription with speaker identification"
|
description = "Voice to Notes — desktop transcription with speaker identification"
|
||||||
authors = ["Voice to Notes Contributors"]
|
authors = ["Voice to Notes Contributors"]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://schema.tauri.app/config/2",
|
"$schema": "https://schema.tauri.app/config/2",
|
||||||
"productName": "Voice to Notes",
|
"productName": "Voice to Notes",
|
||||||
"version": "0.2.0",
|
"version": "0.2.1",
|
||||||
"identifier": "com.voicetonotes.app",
|
"identifier": "com.voicetonotes.app",
|
||||||
"build": {
|
"build": {
|
||||||
"beforeDevCommand": "npm run dev",
|
"beforeDevCommand": "npm run dev",
|
||||||
|
|||||||
Reference in New Issue
Block a user