53 lines
1.2 KiB
YAML
53 lines
1.2 KiB
YAML
name: Publish Obsidian plugin
|
|
|
|
on:
|
|
push:
|
|
tags: ["*"]
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
publish-plugin:
|
|
runs-on: self-hosted
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js environment
|
|
uses: actions/setup-node@v4.2.0
|
|
with:
|
|
node-version: "22.x"
|
|
check-latest: true
|
|
|
|
- name: Build plugin
|
|
run: |
|
|
cd frontend
|
|
npm ci
|
|
npm run build
|
|
|
|
- name: Setup Rust toolchain
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
toolchain: "1.89.0"
|
|
|
|
- name: Install cross-compilation tools
|
|
run: |
|
|
sudo apt update
|
|
sudo apt install -y gcc-aarch64-linux-gnu musl-tools gcc-mingw-w64-x86-64
|
|
|
|
- name: Build Linux and Windows binaries
|
|
run: ./scripts/build-sync-server-binaries.sh
|
|
|
|
- name: Create release
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
tag="${GITHUB_REF#refs/tags/}"
|
|
|
|
cd frontend/obsidian-plugin/dist
|
|
|
|
gh release create "$tag" \
|
|
--title="$tag" \
|
|
--draft \
|
|
main.js manifest.json styles.css artifacts/sync-server-*
|