Skip to content

Commit 6f52f33

Browse files
committed
added ci and lock-file
1 parent c529038 commit 6f52f33

2 files changed

Lines changed: 708 additions & 0 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: build and release
2+
3+
on:
4+
release:
5+
types: [ created ]
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
build:
12+
name: ${{ matrix.platform.os_name }} with rust ${{ matrix.toolchain }}
13+
runs-on: ${{ matrix.platform.os }}
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
platform:
18+
- os_name: Linux-aarch64
19+
os: ubuntu-20.04
20+
target: aarch64-unknown-linux-musl
21+
bin: flash-linux-arm64
22+
23+
- os_name: Linux-x86_64
24+
os: ubuntu-20.04
25+
target: x86_64-unknown-linux-gnu
26+
bin: flash-linux-amd64
27+
28+
- os_name: Windows-x86_64
29+
os: windows-latest
30+
target: x86_64-pc-windows-msvc
31+
bin: flash-amd64.exe
32+
33+
- os_name: macOS-x86_64
34+
os: macOS-latest
35+
target: x86_64-apple-darwin
36+
bin: flash-darwin-amd64
37+
38+
- os_name: macOS-aarch64
39+
os: macOS-latest
40+
target: aarch64-apple-darwin
41+
bin: flash-darwin-arm64
42+
toolchain:
43+
- stable
44+
steps:
45+
- uses: actions/checkout@v4
46+
- name: Build binary
47+
uses: houseabsolute/actions-rust-cross@v1
48+
with:
49+
command: "build"
50+
target: ${{ matrix.platform.target }}
51+
toolchain: ${{ matrix.toolchain }}
52+
args: "--locked --release"
53+
strip: true
54+
- name: Rename binary (linux and macos)
55+
run: mv target/${{ matrix.platform.target }}/release/flash target/${{ matrix.platform.target }}/release/${{ matrix.platform.bin }}
56+
if: matrix.platform.os_name != 'Windows-x86_64'
57+
- name: Rename binary (windows)
58+
run: mv target/${{ matrix.platform.target }}/release/flash.exe target/${{ matrix.platform.target }}/release/${{ matrix.platform.bin }}
59+
if: matrix.platform.os_name == 'Windows-x86_64'
60+
- name: Generate SHA-256
61+
run: shasum -a 256 target/${{ matrix.platform.target }}/release/${{ matrix.platform.bin }} | cut -d ' ' -f 1 > target/${{ matrix.platform.target }}/release/${{ matrix.platform.bin }}.sha256
62+
- name: Release binary and SHA-256 checksum to GitHub
63+
uses: softprops/action-gh-release@v2
64+
with:
65+
files: |
66+
target/${{ matrix.platform.target }}/release/${{ matrix.platform.bin }}
67+
target/${{ matrix.platform.target }}/release/${{ matrix.platform.bin }}.sha256

0 commit comments

Comments
 (0)