Skip to content

Commit

Permalink
rust tauri
Browse files Browse the repository at this point in the history
  • Loading branch information
heliannuuthus committed Apr 18, 2024
1 parent e4fec87 commit fba13aa
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 5 deletions.
21 changes: 16 additions & 5 deletions .github/workflows/call-rust-tauri.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ on:
description: "Specify test command"

jobs:
setup:
build-tauri:

permissions:
contents: write
Expand All @@ -40,7 +40,7 @@ jobs:
args: "--target aarch64-apple-darwin"
- platform: "macos-latest"
args: "--target x86_64-apple-darwin"
- platform: "ubuntu-20.04"
- platform: "ubuntu-latest"
args: ""
- platform: "windows-latest"
args: ""
Expand All @@ -53,7 +53,7 @@ jobs:
- uses: actions/checkout@v4
- name: linux install dependencies
uses: awalsh128/cache-apt-pkgs-action@latest
if: matrix.settings.platform == 'ubuntu-20.04'
if: matrix.settings.platform == 'ubuntu-latest'
with:
packages: libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
version: rust-tauri-ci
Expand Down Expand Up @@ -117,7 +117,8 @@ jobs:
- name: rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: "${{ inputs.node_workdir }}/src-tauri -> target"
workspaces: "${{ inputs.node_workdir }}/src-tauri"
cache-targets: false

- name: install frontend dependencies
run: pnpm install && pnpm eslint --fix . && pnpm prettier --write .
Expand All @@ -136,7 +137,8 @@ jobs:
shell: bash


- uses: tauri-apps/tauri-action@v0
- id: tauri-action
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand All @@ -147,3 +149,12 @@ jobs:
prerelease: false
args: ${{ matrix.settings.args }}

- name: upload tauri-artifact
uses: actions/upload-artifact@v4
with:
name: tauri-artifact
path: |
${{ fromJSON(steps.tauri-action.outputs.artifactPaths)[0] }}
${{ fromJSON(steps.tauri-action.outputs.artifactPaths)[1] }}
${{ fromJSON(steps.tauri-action.outputs.artifactPaths)[2] }}
10 changes: 10 additions & 0 deletions templates/rust-tauri/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"version": "rust-tauri-ci"
}
},
<<<<<<< HEAD
"lint": {},
"security": {},
"build": {
Expand All @@ -61,6 +62,15 @@
"${{ inputs.rust_workdir }}target/release/${{ steps.environments.outputs.project }}",
"${{ inputs.rust_workdir }}target/default/report.xml",
"${{ inputs.rust_workdir }}target/cobertura.xml"
=======
"build_tauri": {
"upload": {
"name": "tauri-artifact",
"paths": [
"${{ fromJSON(steps.tauri-action.outputs.artifactPaths)[0] }}",
"${{ fromJSON(steps.tauri-action.outputs.artifactPaths)[1] }}",
"${{ fromJSON(steps.tauri-action.outputs.artifactPaths)[2] }}"
>>>>>>> a522afb (rust tauri)
]
}
}
Expand Down
18 changes: 18 additions & 0 deletions templates/rust-tauri/extra.j2
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ strategy:
args: "--target aarch64-apple-darwin"
- platform: "macos-latest"
args: "--target x86_64-apple-darwin"
<<<<<<< HEAD
- platform: "ubuntu-20.04"
=======
- platform: "ubuntu-latest"
>>>>>>> a522afb (rust tauri)
args: ""
- platform: "windows-latest"
args: ""
Expand All @@ -27,7 +31,11 @@ steps:
{% macro apt_cache(version, packages=[]) -%}
- name: linux install dependencies
uses: awalsh128/cache-apt-pkgs-action@latest
<<<<<<< HEAD
if: matrix.settings.platform == 'ubuntu-20.04'
=======
if: matrix.settings.platform == 'ubuntu-latest'
>>>>>>> a522afb (rust tauri)
with:
packages: {% for package in packages -%} {{ package }} {% endfor +%}
version: {{ version }}
Expand All @@ -44,7 +52,12 @@ steps:
- name: rust cache
uses: swatinem/rust-cache@v2
with:
<<<<<<< HEAD
workspaces: "${{ inputs.node_workdir }}/src-tauri -> target"
=======
workspaces: "${{ inputs.node_workdir }}/src-tauri"
cache-targets: false
>>>>>>> a522afb (rust tauri)

- name: install frontend dependencies
run: pnpm install && pnpm eslint --fix . && pnpm prettier --write .
Expand All @@ -53,7 +66,12 @@ steps:

{% set tauri -%}
{%- raw %}
<<<<<<< HEAD
- uses: tauri-apps/tauri-action@v0
=======
- id: tauri-action
uses: tauri-apps/tauri-action@v0
>>>>>>> a522afb (rust tauri)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down
8 changes: 8 additions & 0 deletions templates/rust-tauri/index.j2
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,18 @@ on:
{% endif %}

jobs:
<<<<<<< HEAD
setup:
=======
build-tauri:
>>>>>>> a522afb (rust tauri)
{{ rust_tauri.init(data.workdir) | indent(4) }}
{{ rust_tauri.apt_cache(data.setup.apt.version, data.setup.apt.packages) | indent(6) }}
{{ node.init | indent(6) }}
{{ rust_tauri.toolchain_cache | indent(6) }}
{{ rust.env | indent(6) }}
{{ rust_tauri.tauri | indent(6) }}
<<<<<<< HEAD
=======
{{ actions.upload(data.build_tauri.upload.name, data.build_tauri.upload.paths) | indent(6) }}
>>>>>>> a522afb (rust tauri)

0 comments on commit fba13aa

Please sign in to comment.