Skip to content

chore(release): bump version to 1.3.0 #78

chore(release): bump version to 1.3.0

chore(release): bump version to 1.3.0 #78

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- platform: macos-latest
args: --target aarch64-apple-darwin
target: aarch64-apple-darwin
- platform: macos-latest
args: --target x86_64-apple-darwin
target: x86_64-apple-darwin
- platform: ubuntu-22.04
args: ""
target: x86_64-unknown-linux-gnu
- platform: windows-latest
args: ""
target: x86_64-pc-windows-msvc
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install dependencies (Ubuntu only)
if: matrix.platform == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libasound2-dev
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 9
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: "./packages/app/src-tauri -> target"
- name: Install frontend dependencies
run: pnpm install
- name: Verify version consistency
run: node scripts/bump-version.js --check
- name: Build Tauri app
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
VITE_FEEDBACK_WORKER_URL: ${{ secrets.FEEDBACK_WORKER_URL }}
with:
projectPath: "./packages/app"
tagName: ${{ github.ref_name }}
releaseName: "ReadAny ${{ github.ref_name }}"
releaseBody: "See ASSETS to download and install this version."
releaseDraft: true
prerelease: false
args: ${{ matrix.args }}
build-android:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 9
- name: Install dependencies
run: pnpm install
- name: Build reader assets
run: pnpm --filter @readany/app-expo run build:reader
- name: Setup Expo
uses: expo/expo-github-action@v8
with:
expo-version: latest
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}
- name: Build Android APK (Local)
env:
EXPO_PUBLIC_FEEDBACK_WORKER_URL: ${{ secrets.FEEDBACK_WORKER_URL }}
run: |
VERSION=${GITHUB_REF_NAME#v}
cd packages/app-expo
npx eas-cli build --platform android --profile preview --local --non-interactive --output=../../ReadAny-${VERSION}.apk
- name: Upload to Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: ReadAny-*.apk
tag_name: ${{ github.ref_name }}
draft: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
create-updater-json:
needs: [build, build-android]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get version
id: version
run: |
VERSION=${GITHUB_REF_NAME#v}
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Wait for release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Wait for release to be created
for i in {1..30}; do
if gh release view ${{ github.ref_name }} --json tagName --jq '.tagName' 2>/dev/null; then
echo "Release found"
break
fi
sleep 5
done
# Check if release is a draft
IS_DRAFT=$(gh release view ${{ github.ref_name }} --json isDraft --jq '.')
if [ "$IS_DRAFT" = "true" ]; then
echo "Release is a draft, skipping latest.json upload"
exit 0
fi
- name: Download signature files and generate latest.json
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION="${{ steps.version.outputs.version }}"
REPO="${{ github.repository }}"
TAG="${{ github.ref_name }}"
# Download .sig files from the release (generated by tauri-action with TAURI_SIGNING_PRIVATE_KEY)
mkdir -p sigs
gh release download "$TAG" --pattern "*.sig" --dir sigs 2>/dev/null || true
# Read signatures (fallback to empty if sig file not found)
read_sig() {
local file="$1"
if [ -f "sigs/$file" ]; then
cat "sigs/$file"
else
echo ""
fi
}
SIG_DARWIN_AARCH64=$(read_sig "ReadAny_aarch64.app.tar.gz.sig")
SIG_DARWIN_X64=$(read_sig "ReadAny_x64.app.tar.gz.sig")
SIG_WINDOWS=$(read_sig "ReadAny_${VERSION}_x64-setup.exe.sig")
SIG_LINUX=$(read_sig "readany_${VERSION}_amd64.deb.sig")
cat > latest.json << EOF
{
"version": "${VERSION}",
"notes": "See https://github.com/${REPO}/releases/tag/${TAG} for details",
"pub_date": "$(date -u +"%Y-%m-%dT%H:%M:%SZ")",
"platforms": {
"darwin-aarch64": {
"signature": "${SIG_DARWIN_AARCH64}",
"url": "https://github.com/${REPO}/releases/download/${TAG}/ReadAny_aarch64.app.tar.gz"
},
"darwin-x86_64": {
"signature": "${SIG_DARWIN_X64}",
"url": "https://github.com/${REPO}/releases/download/${TAG}/ReadAny_x64.app.tar.gz"
},
"windows-x86_64": {
"signature": "${SIG_WINDOWS}",
"url": "https://github.com/${REPO}/releases/download/${TAG}/ReadAny_${VERSION}_x64-setup.exe"
},
"linux-x86_64": {
"signature": "${SIG_LINUX}",
"url": "https://github.com/${REPO}/releases/download/${TAG}/readany_${VERSION}_amd64.deb"
}
}
}
EOF
- name: Upload latest.json
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ github.ref_name }} latest.json --clobber
update-homebrew:
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Get version
id: version
run: |
VERSION=${GITHUB_REF_NAME#v}
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Wait for release assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG="${{ github.ref_name }}"
for i in {1..30}; do
ASSETS=$(gh api repos/${{ github.repository }}/releases/tags/$TAG --jq '.assets[].name' 2>/dev/null || echo "")
if echo "$ASSETS" | grep -q "ReadAny_aarch64.app.tar.gz"; then
echo "macOS assets found"
break
fi
echo "Waiting for macOS assets... ($i)"
sleep 10
done
- name: Calculate SHA256
id: sha
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG="${{ github.ref_name }}"
SHA_ARM=$(curl -sL "https://github.com/${{ github.repository }}/releases/download/${TAG}/ReadAny_aarch64.app.tar.gz" | sha256sum | cut -d' ' -f1)
SHA_INTEL=$(curl -sL "https://github.com/${{ github.repository }}/releases/download/${TAG}/ReadAny_x64.app.tar.gz" | sha256sum | cut -d' ' -f1)
echo "arm=$SHA_ARM" >> $GITHUB_OUTPUT
echo "intel=$SHA_INTEL" >> $GITHUB_OUTPUT
echo "ARM SHA256: $SHA_ARM"
echo "Intel SHA256: $SHA_INTEL"
- name: Update Homebrew formula
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION="${{ steps.version.outputs.version }}"
SHA_ARM="${{ steps.sha.outputs.arm }}"
SHA_INTEL="${{ steps.sha.outputs.intel }}"
cat > /tmp/readany.rb << 'FORMULA'
cask "readany" do
version "VERSION_PLACEHOLDER"
on_arm do
sha256 "SHA_ARM_PLACEHOLDER"
url "https://github.com/codedogQBY/ReadAny/releases/download/v#{version}/ReadAny_aarch64.app.tar.gz"
end
on_intel do
sha256 "SHA_INTEL_PLACEHOLDER"
url "https://github.com/codedogQBY/ReadAny/releases/download/v#{version}/ReadAny_x64.app.tar.gz"
end
name "ReadAny"
desc "AI-powered cross-platform ebook reader"
homepage "https://github.com/codedogQBY/ReadAny"
app "ReadAny.app"
zap trash: [
"~/Library/Application Support/com.readany.app",
"~/Library/Caches/com.readany.app",
"~/Library/Preferences/com.readany.app.plist",
]
end
FORMULA
sed -i "s/VERSION_PLACEHOLDER/$VERSION/g" /tmp/readany.rb
sed -i "s/SHA_ARM_PLACEHOLDER/$SHA_ARM/g" /tmp/readany.rb
sed -i "s/SHA_INTEL_PLACEHOLDER/$SHA_INTEL/g" /tmp/readany.rb
# Remove leading whitespace from heredoc
sed -i 's/^ //' /tmp/readany.rb
# Update the formula in homebrew-readany repo via GitHub API
CONTENT=$(base64 -w 0 /tmp/readany.rb)
EXISTING_SHA=$(gh api repos/codedogQBY/homebrew-readany/contents/Casks/readany.rb --jq '.sha' 2>/dev/null || echo "")
if [ -n "$EXISTING_SHA" ]; then
gh api repos/codedogQBY/homebrew-readany/contents/Casks/readany.rb \
-X PUT \
-f message="chore: bump ReadAny to v${VERSION}" \
-f content="$CONTENT" \
-f sha="$EXISTING_SHA"
else
gh api repos/codedogQBY/homebrew-readany/contents/Casks/readany.rb \
-X PUT \
-f message="chore: bump ReadAny to v${VERSION}" \
-f content="$CONTENT"
fi
echo "✅ Homebrew formula updated to v${VERSION}"