Skip to content

Commit 3396c17

Browse files
committed
Try to setup prebuilt binaries for releases
1 parent 0d5fd20 commit 3396c17

File tree

2 files changed

+60
-22
lines changed

2 files changed

+60
-22
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Build and test
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
tags:
7+
- 'v*.*.*'
8+
pull_request:
9+
branches: [ "main" ]
10+
11+
env:
12+
CARGO_TERM_COLOR: always
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: Build
20+
run: cargo build --verbose
21+
- name: Run tests
22+
run: cargo test --verbose --exclude fathom --workspace
23+
24+
deploy:
25+
name: deploy
26+
needs: [build]
27+
if: startsWith(github.ref, 'refs/tags/')
28+
runs-on: ubuntu-latest
29+
strategy:
30+
matrix:
31+
target: [ aarch64-unknown-linux-gnu, armv7-unknown-linux-gnueabihf, arm-unknown-linux-gnueabi, x86_64-unknown-linux-gnu, x86_64-unknown-linux-musl]
32+
steps:
33+
- name: Checkout
34+
uses: actions/checkout@v1
35+
- name: Install rust
36+
uses: actions-rs/toolchain@v1
37+
with:
38+
toolchain: stable
39+
profile: minimal
40+
override: true
41+
target: ${{ matrix.target }}
42+
43+
- name: Build target
44+
uses: actions-rs/cargo@v1
45+
with:
46+
use-cross: true
47+
command: build
48+
args: --bin goldfish --profile release-lto --target ${{ matrix.target }}
49+
50+
- name: Package
51+
shell: bash
52+
run: |
53+
cp target/${{ matrix.target }}/release-lto/goldfish goldfish-${{ matrix.target }}
54+
- name: Publish
55+
uses: softprops/action-gh-release@v1
56+
# TODO: if any of the build step fails, the release should be deleted.
57+
with:
58+
files: 'goldfish*'
59+
env:
60+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/cargo-build-test.yml

-22
This file was deleted.

0 commit comments

Comments
 (0)