aboutsummaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-05-10 06:39:50 +0000
committerBlaž Hrastnik2021-05-10 06:41:21 +0000
commit274c413f5a90252adbd9d0a7f1f2a8f914ec1707 (patch)
treec994d806d94d8fcb98ba959694bf76d9317bbd26 /.github
parent0f77f543e5a7a6be0eabd2d4b72591cdafc7ec71 (diff)
Try building (but not packaging yet) binary releases.
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/release.yml85
1 files changed, 85 insertions, 0 deletions
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 00000000..73964ef6
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,85 @@
+name: Release
+on:
+ schedule:
+ - cron: '0 0 * * *' # midnight UTC
+
+ push:
+ branches:
+ - release
+
+jobs:
+ dist:
+ name: Dist
+ runs-on: ${{ matrix.os }}
+ strategy:
+ matrix:
+ build: [linux, linux-arm, macos, win-msvc, win-gnu, win32-msvc]
+ include:
+ - build: linux
+ os: ubuntu-20.04
+ rust: nightly
+ target: x86_64-unknown-linux-musl
+ - build: linux-arm
+ os: ubuntu-20.04
+ rust: nightly
+ target: arm-unknown-linux-gnueabihf
+ - build: macos
+ os: macos-latest
+ rust: nightly
+ target: x86_64-apple-darwin
+ - build: win-msvc
+ os: windows-2019
+ rust: nightly
+ target: x86_64-pc-windows-msvc
+ # - build: win-gnu
+ # os: windows-2019
+ # rust: nightly-x86_64-gnu
+ # target: x86_64-pc-windows-gnu
+ # - build: win32-msvc
+ # os: windows-2019
+ # rust: nightly
+ # target: i686-pc-windows-msvc
+
+ steps:
+ - name: Checkout sources
+ uses: actions/checkout@v2
+ with:
+ submodules: true
+
+ - name: Install ${{ matrix.rust }} toolchain
+ uses: actions-rs/toolchain@v1
+ with:
+ profile: minimal
+ toolchain: ${{ matrix.rust }}
+ target: ${{ matrix.target }}
+ override: true
+
+ - name: Build release binary
+ uses: actions-rs/cargo@v1
+ with:
+ use-cross: true
+ command: build
+ args: --release --locked --target ${{ matrix.target }}
+
+ - name: Run cargo test
+ uses: actions-rs/cargo@v1
+ with:
+ use-cross: true
+ command: test
+ args: --release --locked
+
+ - name: Strip release binary (linux and macos)
+ if: matrix.build == 'linux' || matrix.build == 'macos'
+ run: strip "target/${{ matrix.target }}/release/rg"
+
+ - name: Strip release binary (arm)
+ if: matrix.build == 'linux-arm'
+ run: |
+ docker run --rm -v \
+ "$PWD/target:/target:Z" \
+ rustembedded/cross:arm-unknown-linux-gnueabihf \
+ arm-linux-gnueabihf-strip \
+ /target/arm-unknown-linux-gnueabihf/release/rg
+
+ # package
+ # upload to nightly release