Skip to content

Bump version to 0.1.6 across project files #8

Bump version to 0.1.6 across project files

Bump version to 0.1.6 across project files #8

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*.*.*'
jobs:
# Check if tag is on release branch
check-branch:
runs-on: ubuntu-latest
outputs:
on_release_branch: ${{ steps.check.outputs.on_release }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check if tag is on release branch
id: check
run: |
# Get branches containing this tag
BRANCHES=$(git branch -r --contains ${{ github.ref }})
echo "Branches containing this tag: $BRANCHES"
if echo "$BRANCHES" | grep -q "origin/release"; then
echo "✅ Tag is on release branch"
echo "on_release=true" >> $GITHUB_OUTPUT
else
echo "❌ Tag is NOT on release branch"
echo "on_release=false" >> $GITHUB_OUTPUT
fi
create-release:
needs: check-branch
if: needs.check-branch.outputs.on_release_branch == 'true'
permissions:
contents: write
runs-on: ubuntu-latest
outputs:
release_id: ${{ steps.create-release.outputs.result }}
release_upload_url: ${{ steps.create-release.outputs.upload_url }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get version from tag
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Create release
id: create-release
uses: actions/github-script@v7
env:
VERSION: ${{ steps.get_version.outputs.VERSION }}
with:
script: |
const { data } = await github.rest.repos.createRelease({
owner: context.repo.owner,
repo: context.repo.repo,
tag_name: process.env.VERSION,
name: `VibeBase ${process.env.VERSION}`,
body: 'See the assets below to download this version.',
draft: true,
prerelease: false
})
return data.id
build-tauri:
needs: [check-branch, create-release]
if: needs.check-branch.outputs.on_release_branch == 'true'
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
# macOS Apple Silicon
- platform: macos-latest
target: aarch64-apple-darwin
rust_target: aarch64-apple-darwin
# macOS Intel
- platform: macos-latest
target: x86_64-apple-darwin
rust_target: x86_64-apple-darwin
# Windows x64
- platform: windows-latest
target: x86_64-pc-windows-msvc
rust_target: x86_64-pc-windows-msvc
# Linux x64
- platform: ubuntu-22.04
target: x86_64-unknown-linux-gnu
rust_target: x86_64-unknown-linux-gnu
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.0-dev \
build-essential \
curl \
wget \
file \
libssl-dev \
libgtk-3-dev \
libayatana-appindicator3-dev \
librsvg2-dev
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.rust_target }}
- name: Install frontend dependencies
run: npm ci
- name: Setup Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: './src-tauri -> target'
- name: Build Tauri app
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
# TAURI_KEY_PASSWORD is optional - only set if you used a password
# If you generated keys with empty password, don't add this secret to GitHub
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
# Code signing secrets (uncomment when certificates are available)
# macOS
# APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
# APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
# APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
# APPLE_ID: ${{ secrets.APPLE_ID }}
# APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
# APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
# Windows
# WINDOWS_CERTIFICATE: ${{ secrets.WINDOWS_CERTIFICATE }}
# WINDOWS_CERTIFICATE_PASSWORD: ${{ secrets.WINDOWS_CERTIFICATE_PASSWORD }}
with:
releaseId: ${{ needs.create-release.outputs.release_id }}
args: --target ${{ matrix.rust_target }}
publish-release:
permissions:
contents: write
runs-on: ubuntu-latest
needs: [check-branch, create-release, build-tauri]
if: needs.check-branch.outputs.on_release_branch == 'true'
steps:
- name: Publish release
uses: actions/github-script@v7
env:
RELEASE_ID: ${{ needs.create-release.outputs.release_id }}
with:
script: |
await github.rest.repos.updateRelease({
owner: context.repo.owner,
repo: context.repo.repo,
release_id: process.env.RELEASE_ID,
draft: false
})