@@ -0,0 +1,85 @@
1+name: Release
2+on:
3+ schedule:
4+ - cron: '0 0 * * *' # midnight UTC
5+
6+ push:
7+ branches:
8+ - release
9+
10+jobs:
11+ dist:
12+ name: Dist
13+ runs-on: ${{ matrix.os }}
14+ strategy:
15+ matrix:
16+ build: [linux, linux-arm, macos, win-msvc, win-gnu, win32-msvc]
17+ include:
18+ - build: linux
19+ os: ubuntu-20.04
20+ rust: nightly
21+ target: x86_64-unknown-linux-musl
22+ - build: linux-arm
23+ os: ubuntu-20.04
24+ rust: nightly
25+ target: arm-unknown-linux-gnueabihf
26+ - build: macos
27+ os: macos-latest
28+ rust: nightly
29+ target: x86_64-apple-darwin
30+ - build: win-msvc
31+ os: windows-2019
32+ rust: nightly
33+ target: x86_64-pc-windows-msvc
34+ # - build: win-gnu
35+ # os: windows-2019
36+ # rust: nightly-x86_64-gnu
37+ # target: x86_64-pc-windows-gnu
38+ # - build: win32-msvc
39+ # os: windows-2019
40+ # rust: nightly
41+ # target: i686-pc-windows-msvc
42+
43+ steps:
44+ - name: Checkout sources
45+ uses: actions/checkout@v2
46+ with:
47+ submodules: true
48+
49+ - name: Install ${{ matrix.rust }} toolchain
50+ uses: actions-rs/toolchain@v1
51+ with:
52+ profile: minimal
53+ toolchain: ${{ matrix.rust }}
54+ target: ${{ matrix.target }}
55+ override: true
56+
57+ - name: Build release binary
58+ uses: actions-rs/cargo@v1
59+ with:
60+ use-cross: true
61+ command: build
62+ args: --release --locked --target ${{ matrix.target }}
63+
64+ - name: Run cargo test
65+ uses: actions-rs/cargo@v1
66+ with:
67+ use-cross: true
68+ command: test
69+ args: --release --locked
70+
71+ - name: Strip release binary (linux and macos)
72+ if: matrix.build == 'linux' || matrix.build == 'macos'
73+ run: strip "target/${{ matrix.target }}/release/rg"
74+
75+ - name: Strip release binary (arm)
76+ if: matrix.build == 'linux-arm'
77+ run: |
78+ docker run --rm -v \
79+ "$PWD/target:/target:Z" \
80+ rustembedded/cross:arm-unknown-linux-gnueabihf \
81+ arm-linux-gnueabihf-strip \
82+ /target/arm-unknown-linux-gnueabihf/release/rg
83+
84+ # package
85+ # upload to nightly release