Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Actions Docs #2313

Merged
merged 30 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
b68582f
Create snapcraft.mdx
RoseBlume Jun 17, 2024
b33612b
Fixing
RoseBlume Jun 17, 2024
d1dc05e
Fixing
RoseBlume Jun 17, 2024
44bd57e
Update snapcraft.mdx
RoseBlume Jun 17, 2024
0b95cd4
Update snapcraft.mdx
RoseBlume Jun 17, 2024
51037f8
Merge branch 'v2' into v2
RoseBlume Jun 17, 2024
0272a91
Merge branch 'v2' into v2
RoseBlume Jun 18, 2024
0c1e15d
Create actions.mdx
RoseBlume Jun 18, 2024
ce8189e
Delete src/content/docs/distribute/snapcraft.mdx
RoseBlume Jun 19, 2024
9125c0c
Merge branch 'tauri-apps:v2' into actions
RoseBlume Jun 19, 2024
11f0035
Update actions.mdx
RoseBlume Jun 19, 2024
a905e6c
Update actions.mdx
RoseBlume Jun 19, 2024
a0c7a5b
Update .prettierignore
RoseBlume Jun 19, 2024
82120e9
Merge branch 'v2' into actions
RoseBlume Jun 20, 2024
314741c
Merge branch 'v2' into actions
RoseBlume Jun 21, 2024
cfb3983
Merge branch 'v2' into actions
RoseBlume Jun 24, 2024
52f74e9
Merge branch 'v2' into actions
RoseBlume Jun 25, 2024
eead1bb
fix: building with actions syntax
brenoepics Jun 25, 2024
fa54e4f
Merge branch 'v2' into actions
RoseBlume Jun 25, 2024
bb257dc
Merge pull request #1 from brenoepics/actions
RoseBlume Jun 25, 2024
3bf45bb
Merge branch 'v2' into actions
RoseBlume Jun 30, 2024
3c1c8f0
Merge remote-tracking branch 'origin/v2' into actions
FabianLars Jul 1, 2024
7e63d04
move to dist/pipelines
FabianLars Jul 1, 2024
937ed2c
a few touchups - wip (trying to fix appimage builds)
FabianLars Jul 1, 2024
8d01606
fix workflow (gave up on image caching)
FabianLars Jul 3, 2024
ed6f857
Merge branch 'v2' into actions
RoseBlume Jul 4, 2024
0db8c42
port more v1 stuff
FabianLars Jul 4, 2024
29f77ee
fmt
FabianLars Jul 4, 2024
29018a0
Merge branch 'v2' into actions
FabianLars Jul 4, 2024
8e8c04b
Merge branch 'v2' into actions
FabianLars Jul 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,6 @@ src/content/docs/learn/Security/using-plugin-permissions.mdx
src/content/docs/learn/Security/writing-plugin-permissions.mdx
src/content/docs/start/frontend/qwik.mdx
src/content/docs/zh-cn/start/frontend/qwik.mdx
src/content/docs/learn/splashscreen.mdx
src/content/docs/learn/splashscreen.mdx
src/content/docs/distribute/snapcraft.mdx
src/content/docs/develop/actions.mdx
154 changes: 154 additions & 0 deletions src/content/docs/develop/actions.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
---
title: Actions
sidebar:
order: 1
---


## Contents
- Cross platform compilation and automating releases
- Compiling for arm using [Pguyots](https://github.com/pguyot) arm-runner
- Compiling on self hosted runners

### Basic Cross Platform Compilation

```yaml
name: 'publish'

on:
push:
branches:
- release

jobs:
publish-tauri:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
settings:
RoseBlume marked this conversation as resolved.
Show resolved Hide resolved
- platform: 'macos-latest' # for Arm based macs (M1 and above).
args: '--target aarch64-apple-darwin'
- platform: 'macos-latest' # for Intel based macs.
args: '--target x86_64-apple-darwin'
- platform: 'ubuntu-22.04' # for Tauri v1 you could replace this with ubuntu-20.04.
args: ''
- platform: 'windows-latest'
args: ''

runs-on: ${{ matrix.settings.platform }}
RoseBlume marked this conversation as resolved.
Show resolved Hide resolved
steps:
- uses: actions/checkout@v4

- name: install dependencies (ubuntu only)
if: matrix.settings.platform == 'ubuntu-22.04' # This must match the platform value defined above.
RoseBlume marked this conversation as resolved.
Show resolved Hide resolved
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
# webkitgtk 4.0 is for Tauri v1 - webkitgtk 4.1 is for Tauri v2.
# You can remove the one that doesn't apply to your app to speed up the workflow a bit.

- name: setup node
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: 'yarn' # Set this to npm, yarn or pnpm.

- name: install Rust stable
uses: dtolnay/rust-toolchain@stable # Set this to dtolnay/rust-toolchain@nightly
with:
# Those targets are only used on macos runners so it's in an `if` to slightly speed up windows and linux builds.
targets: ${{ matrix.settings.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
RoseBlume marked this conversation as resolved.
Show resolved Hide resolved

- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: './src-tauri -> target'

- name: install frontend dependencies
# If you don't have `beforeBuildCommand` configured you may want to build your frontend here too.
run: yarn install # change this to npm or pnpm depending on which one you use.

- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tagName: app-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version.
releaseName: 'App v__VERSION__'
releaseBody: 'See the assets to download this version and install.'
releaseDraft: true
prerelease: false
args: ${{ matrix.settings.args }}
```

### Arm Runner Compilation
The process in which you cross compile is quite similar to version 1, however one small change is
that the base_image uses `Bookworm` instead of `Bullseye`. It is important to note that the `VERSION` variable must be adjusted to your version in `tauri.conf.json` each time you update.

```yaml
name: Raspberry Pi compile
on:
workflow_dispatch:
env:
VERSION: 2.0.5
jobs:
build:
strategy:
matrix:
arch: [aarch64, armv7l]
include:
- arch: aarch64
cpu: cortex-a72
base_image: https://dietpi.com/downloads/images/DietPi_RPi-ARMv8-Bookworm.img.xz
deb: arm64
other: aarch64
- arch: armv7l
cpu: cortex-a53
deb: armhfp
other: arm
base_image: https://dietpi.com/downloads/images/DietPi_RPi-ARMv7-Bookworm.img.xz
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pguyot/[email protected]
with:
base_image: ${{ matrix.base_image }}
cpu: ${{ matrix.cpu }}
bind_mount_repository: true
image_additional_mb: 10240
optimize_image: false
commands: |
# Rust complains (rightly) that $HOME doesn't match eid home
export HOME=/root
# Workaround to CI worker being stuck on Updating crates.io index
export CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
# Install setup prerequisites
apt-get update -y --allow-releaseinfo-change
apt-get autoremove -y
apt-get install -y curl npm libwebkit2gtk-4.1-dev build-essential libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly
. "$HOME/.cargo/env"
# curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash
# Install framework specific packages
sudo npm install --force -g npm@latest
sudo npm install --force -g nodejs@latest
# Install Rust Nightly
rustup default nightly # Only Enable for nightly builds
# Install frontend dependencies
npm install
# Build the application
npm run tauri build -- --bundles deb rpm
- name: Upload deb bundle
uses: actions/upload-artifact@v3
with:
name: Debian Bundle
path: ${{ github.workspace }}/src-tauri/target/release/bundle/deb/Rosary_${{ env.VERSION }}_${{ matrix.deb }}.deb

- name: Upload rpm bundle
uses: actions/upload-artifact@v3
with:
name: RPM Bundle
path: ${{ github.workspace }}/src-tauri/target/release/bundle/rpm/rosary_${{ env.VERSION }}-1_${{ matrix.other }}.rpm
```

Loading