Implementing multiarch build.

This commit is contained in:
Antoine POPINEAU 2020-06-29 08:15:26 +02:00
parent 53b80f93a2
commit d647a97f07
No known key found for this signature in database
GPG Key ID: A78AC64694F84063

View File

@ -3,6 +3,8 @@ on:
push:
branches:
- master
- dev/ci
jobs:
clippy:
runs-on: ubuntu-latest
@ -15,19 +17,48 @@ jobs:
with:
command: clippy
build:
runs-on: ubuntu-latest
strategy:
matrix:
arch:
- { name: 'x86_64', os: 'ubuntu-latest', target: 'x86_64-unknown-linux-gnu', cross: false }
- { name: 'i686', os: 'ubuntu-latest', target: 'i686-unknown-linux-gnu', cross: true }
- { name: 'armv7', os: 'ubuntu-latest', target: 'armv7-unknown-linux-gnueabihf', cross: true }
- { name: 'aarch64', os: 'ubuntu-latest', target: 'aarch64-unknown-linux-gnu', cross: true }
runs-on: ${{ matrix.arch.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: target/
key: cargo-cache-${{ matrix.arch.target }}
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: actions-rs/cargo@v1
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --release
args: --release --target=${{ matrix.arch.target }}
use-cross: ${{ matrix.arch.cross }}
- name: Rename artifact
run: mv target/${{ matrix.arch.target }}/release/tuigreet target/${{ matrix.arch.target }}/release/tuigreet-master-${{ matrix.arch.name }}
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: tuigreet-master-${{ matrix.arch.name }}
path: target/${{ matrix.arch.target }}/release/tuigreet-master-${{ matrix.arch.name }}
package:
runs-on: ubuntu-latest
needs: build
steps:
- name: Download artifacts
uses: actions/download-artifact@v2
with:
path: target/out
- name: Create release
uses: eine/tip@gha-tip
uses: eine/tip@tip
with:
token: ${{ secrets.GITHUB_TOKEN }}
cwd: ${{ github.workspace }}
files: target/release/tuigreet
files: target/out/*/*
rm: true