-
Notifications
You must be signed in to change notification settings - Fork 1
113 lines (90 loc) · 2.49 KB
/
release.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: Release
on:
push:
branches: ["main"]
workflow_dispatch:
jobs:
build-server:
runs-on: ubuntu-latest
strategy:
matrix:
build: [amd64, armhf]
include:
- build: amd64
os: ubuntu-latest
rust: stable
target: x86_64-unknown-linux-gnu
- build: armhf
os: ubuntu-latest
rust: stable
target: armv7-unknown-linux-gnueabihf
env:
CARGO_TERM_COLOR: always
defaults:
run:
shell: bash
working-directory: ./server
steps:
- uses: actions/checkout@v3
- name: 🦀 - Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
override: true
- name: 🌱 - Install dependencies
run: cargo install cross --git https://github.com/cross-rs/cross
- name: 🔨 - Build
run: >
cross build --release --target ${{ matrix.target }} && \
mv target/**/release/rusty_controller server-${{ matrix.build }}
- name: 📦 - Copy artifact
uses: actions/upload-artifact@v4
with:
name: server-${{ matrix.build }}
path: server/server-${{ matrix.build }}
if-no-files-found: error
build-app:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: ./app
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
- name: 🌱 - Get dependencies
run: flutter pub get
- name: 🔨 - Build APK
run: flutter build apk
- run: mv build/app/outputs/flutter-apk/app-release.apk ../app.apk
- name: 📦 - Copy artifact
uses: actions/upload-artifact@v4
with:
name: app.apk
path: app.apk
release:
needs: [build-server, build-app]
runs-on: ubuntu-latest
# Prevents any manual run from triggering a new GH release
if: github.ref_name == 'main' && github.event_name == 'push'
steps:
- uses: actions/checkout@v3
- name: 📦 - Copy server artifacts
uses: actions/download-artifact@v4
with:
path: artifacts/
merge-multiple: true
- name: 🧐 - Display structure of downloaded artifacts
run: ls -R artifacts/
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
with:
branches: |
[
'main',
]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}