Skip to content

ci: update

ci: update #314

Workflow file for this run

name: Release
on:
push:
branches: ["main", "cicd/add-armv7-build"]
jobs:
build-server:
runs-on: ubuntu-latest
strategy:
matrix:
build: [amd64, arm-v7]
include:
- build: amd64
os: ubuntu-latest
rust: stable
target: x86_64-unknown-linux-gnu
platform: linux
- build: arm-v7
os: ubuntu-latest
rust: stable
target: armv7-unknown-linux-gnueabihf
platform: pi
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 }} && ls -R server/target/ && \
mv server/target/**/release/rusty_controller server/rusty_controller-${{ matrix.build }}
- name: 📦 - Copy artifact
uses: actions/upload-artifact@v3
with:
name: rusty_controller-${{ matrix.build }}
path: server/
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 ../RustyController.apk
- name: 📦 - Copy artifact
uses: actions/upload-artifact@v3
with:
name: RustyController.apk
path: RustyController.apk
upload:
needs: [build-server, build-app]
runs-on: ubuntu-latest
steps:
- name: 📦 - Copy server artifacts
uses: actions/download-artifact@v3
with:
path: artifacts/
- name: 📦 - Copy app artifact
uses: actions/download-artifact@v3
with:
path: RustyController.apk
- name: 🧐 - Display structure of downloaded artifacts
run: ls -R
working-directory: .
- name: 🌠 - Release
uses: ncipollo/release-action@v1.12.0
with:
artifacts: "artifacts/**/rusty_controller*,RustyController.apk"
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
removeArtifacts: true
artifactErrorsFailBuild: true
prerelease: true
name: Latest Pre-release
tag: latest