-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
59 lines (54 loc) · 1.88 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: "xc-tauri-rasp-action"
author: "Tzu-Ching Yang"
description: "Github action that utilize xc-tauri-rasp to build debian package for raspberry pi."
branding:
icon: "box"
color: "blue"
inputs:
image:
description: "Image to do cross compilation, which should be the intermediates generated by xcompile.sh in xc-tauri-rasp"
required: false
default: ""
arch:
description: "Architecture of raspberry pi"
required: false
default: arm64
env:
description: "Debian version of compilation environment"
required: false
default: bookworm
path:
description: "Root path of tauri project"
required: false
default: ${{ github.workspace }}
project-name:
description: "Name of the project, will be the prefix of the produced debian package"
required: false
default: "project"
runs:
using: "composite"
steps:
- uses: actions/checkout@v4
- name: Clone xc-tauri-rasp repository
run: |
cd ${{ github.workspace }}
git clone https://github.com/Shiritai/xc-tauri-rasp.git
shell: bash
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Pull image for cross compilation
if: "${{ inputs.image != '' }}"
run: |
docker pull ${{ inputs.image }}
docker image tag ${{ inputs.image }} "${{ inputs.project-name }}-${{ inputs.arch }}-${{ inputs.env }}"
shell: bash
- name: Cross compile using `xc-tauri-rasp`
run: |
mkdir -p ${{ github.workspace }}/target
${{ github.workspace }}/xc-tauri-rasp/xcompile.sh -a ${{ inputs.arch }} -e ${{ inputs.env }} -n ${{ inputs.project-name }} -p ${{ github.workspace }} -t ${{ github.workspace }}/target
shell: bash
- name: Upload the artifact
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.project-name }}.deb
path: ${{ github.workspace }}/target/*.deb