Skip to content

fix: Fix release notes rendering (#292) #144

fix: Fix release notes rendering (#292)

fix: Fix release notes rendering (#292) #144

Workflow file for this run

name: edge
on:
push:
branches:
- main
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
NODE_ENV: production
APP_CHANNEL: edge
jobs:
create-release:
name: Ensure edge release exists
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Create or update edge release
env:
GH_TOKEN: ${{ github.token }}
run: |
# Check if edge release already exists
if gh release view edge >/dev/null 2>&1; then
echo "Edge release already exists, updating body..."
gh release edit edge --notes "**Rolling edge build** - updated with commit ${{ github.sha }}
**⚠️ This is an unstable development build - use at your own risk**
Latest commit: ${{ github.event.head_commit.message }}
Built from: ${{ github.sha }}"
gh release view edge --json assets | jq -r '.assets[].name' | \
while read name; do \
echo Deleting existing asset: "$name"
gh release delete-asset edge "$name" -y
done
else
echo "Creating new edge release..."
gh release create edge \
--title "Edge Release (Rolling)" \
--notes "**Rolling edge build** - updated with commit ${{ github.sha }}
**⚠️ This is an unstable development build - use at your own risk**
Latest commit: ${{ github.event.head_commit.message }}
Built from: ${{ github.sha }}" \
--prerelease \
--latest=false
fi
build-edge:
name: Build edge release
needs: create-release
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- platform: "depot-macos-latest"
args: "--target aarch64-apple-darwin"
- platform: "ubuntu-22.04"
args: ""
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.TS_CLONE_DEPLOY_KEY }}
- 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: Run sccache-cache
uses: mozilla-actions/[email protected]
- uses: pnpm/action-setup@v4
with:
version: latest
- name: setup node
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: "pnpm"
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.platform == 'depot-macos-latest' && 'aarch64-apple-darwin' || '' }}
- name: install frontend dependencies
run: pnpm install
- name: update edge version
run: |
# Get the current version from Cargo.toml
version=$(grep -m 1 '^version = ' Cargo.toml | sed 's/version = "\([^"]*\)".*/\1/')
# Get the short commit SHA
commit_sha=$(git rev-parse --short HEAD)
# Create the new version string
new_version="${version}-${commit_sha}"
# Replace the version in both Cargo.toml files
sed -i.bak "s/^version = \"${version}\"/version = \"${new_version}\"/" Cargo.toml
sed -i.bak "s/^version = \"${version}\"/version = \"${new_version}\"/" backend/Cargo.toml
- uses: tauri-apps/tauri-action@v0
id: tauri-action
env:
TAURI_BUNDLER_DMG_IGNORE_CI: false
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY}}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
NODE_OPTIONS: "--max-old-space-size=6144"
RUSTC_WRAPPER: sccache
with:
args: ${{ matrix.args }}
- name: Rename platform-specific files and upload to GitHub release
env:
GH_TOKEN: ${{ github.token }}
run: |
# Get the artifact paths from tauri-action output
echo "Artifact paths: ${{ steps.tauri-action.outputs.artifactPaths }}"
# Remove brackets and read into array
paths_str=$(echo "${{ steps.tauri-action.outputs.artifactPaths }}" | sed 's/^\[//;s/\]$//')
IFS=',' read -ra paths <<< "$paths_str"
# Determine platform suffix based on matrix args
platform_suffix=""
if [[ "${{ matrix.args }}" == *"aarch64-apple-darwin"* ]]; then
platform_suffix="-aarch64"
elif [[ "${{ matrix.args }}" == *"x86_64-apple-darwin"* ]]; then
platform_suffix="-x86_64"
fi
# Rename files and upload to GitHub release
for file in "${paths[@]}"; do
echo "Checking file: $file"
if [[ "$file" == *.deb ]] || [[ "$file" == *.rpm ]]; then
# Extract directory and filename
dir=$(dirname "$file")
filename=$(basename "$file")
echo "Processing file: $filename"
new_filename=$(echo "$filename" | sed 's/Atuin Desktop/Atuin_Desktop/g')
echo "New filename: $new_filename"
if [[ "$filename" != "$new_filename" ]]; then
new_path="$dir/$new_filename"
echo "Renaming: $file -> $new_path"
mv "$file" "$new_path"
gh release upload "edge" "$new_path" --clobber
else
echo "No rename needed for: $filename"
gh release upload "edge" "$file" --clobber
fi
elif [[ "$file" == *.app.tar.gz ]] || [[ "$file" == *.app.tar.gz.sig ]]; then
# Rename macOS files to include platform suffix
if [[ -n "$platform_suffix" ]]; then
dir=$(dirname "$file")
filename=$(basename "$file")
echo "Processing macOS file: $filename"
if [[ "$file" == *.app.tar.gz.sig ]]; then
new_filename=$(echo "$filename" | sed "s/\.app\.tar\.gz\.sig$/${platform_suffix}.app.tar.gz.sig/")
elif [[ "$file" == *.app.tar.gz ]]; then
new_filename=$(echo "$filename" | sed "s/\.app\.tar\.gz$/${platform_suffix}.app.tar.gz/")
fi
new_path="$dir/$new_filename"
echo "Renaming: $file -> $new_path"
mv "$file" "$new_path"
gh release upload "edge" "$new_path" --clobber
else
gh release upload "edge" "$file" --clobber
fi
elif [[ "$file" == *.app ]]; then
# skip this file
echo "Skipping raw .app bundle: $file"
elif [[ "$file" == *.AppImage ]]; then
# skip AppImage files
echo "Skipping AppImage: $file"
else
gh release upload "edge" "$file" --clobber
fi
done