mirror of
https://github.com/spacemeowx2/blflash.git
synced 2024-11-19 02:09:42 +00:00
ci: add release and cache, fix typo
This commit is contained in:
parent
5f2205f0f0
commit
74ac2d2170
51
.github/workflows/build.yml
vendored
51
.github/workflows/build.yml
vendored
@ -1,51 +0,0 @@
|
||||
on: [push, pull_request]
|
||||
|
||||
name: Build
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os:
|
||||
- ubuntu-latest
|
||||
- macOS-latest
|
||||
- windows-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
target: ${{ matrix.target }}
|
||||
override: true
|
||||
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
use-cross: true
|
||||
command: build
|
||||
args: --release
|
||||
|
||||
cross_compile:
|
||||
name: Cross compile
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
target:
|
||||
- armv7-unknown-linux-gnueabihf
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
target: ${{ matrix.target }}
|
||||
override: true
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
use-cross: true
|
||||
command: build
|
||||
args: --release --target=${{ matrix.target }}
|
||||
|
||||
|
88
.github/workflows/rust.yml
vendored
Normal file
88
.github/workflows/rust.yml
vendored
Normal file
@ -0,0 +1,88 @@
|
||||
on: [push, pull_request]
|
||||
|
||||
name: Build
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
artifact_name: blflash
|
||||
release_name: blflash-linux-amd64
|
||||
- os: windows-latest
|
||||
artifact_name: blflash.exe
|
||||
release_name: blflash-windows-amd64.exe
|
||||
- os: macos-latest
|
||||
artifact_name: blflash
|
||||
release_name: blflash-macos-amd64
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Cache Cargo build
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: target/
|
||||
key: ${{ matrix.os }}-stable-target
|
||||
restore-keys: |
|
||||
${{ matrix.os }}-stable-target
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
target: ${{ matrix.target }}
|
||||
override: true
|
||||
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
use-cross: true
|
||||
command: build
|
||||
args: --release
|
||||
|
||||
- name: Upload binaries to release
|
||||
uses: svenstaro/upload-release-action@v1-release
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
with:
|
||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
file: target/release/${{ matrix.artifact_name }}
|
||||
asset_name: ${{ matrix.release_name }}
|
||||
tag: ${{ github.ref }}
|
||||
|
||||
cross_compile:
|
||||
name: Cross compile
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
target:
|
||||
- armv7-unknown-linux-gnueabihf
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Cache Cargo build
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: target/
|
||||
key: ${{ matrix.os }}-stable-target
|
||||
restore-keys: |
|
||||
${{ matrix.os }}-stable-target
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
target: ${{ matrix.target }}
|
||||
override: true
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
use-cross: true
|
||||
command: build
|
||||
args: --release --target=${{ matrix.target }}
|
||||
- name: Upload binaries to release
|
||||
uses: svenstaro/upload-release-action@v1-release
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
with:
|
||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
file: target/${{ matrix.target }}/release/blflash
|
||||
asset_name: blflash-${{ matrix.target }}
|
||||
tag: ${{ github.ref }}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user