add release script for nightly builds

This commit is contained in:
zonyitoo
2021-05-15 00:54:29 +08:00
parent d74e607fba
commit a213db5b3a
2 changed files with 97 additions and 0 deletions

View File

@@ -0,0 +1,96 @@
name: Build Nightly Releases
on:
push:
branches: [master]
env:
CARGO_TERM_COLOR: always
jobs:
build-cross:
runs-on: ubuntu-latest
env:
RUST_BACKTRACE: full
strategy:
matrix:
target:
- x86_64-unknown-linux-musl
- aarch64-unknown-linux-musl
steps:
- uses: actions/checkout@v2
- name: Install cross
run: cargo install cross
- name: Build ${{ matrix.target }}
timeout-minutes: 120
run: |
cd build
./build-release -t ${{ matrix.target }}
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: Releases
path: build/release/*
build-unix:
runs-on: ${{ matrix.os }}
env:
BUILD_EXTRA_FEATURES: "local-redir"
RUST_BACKTRACE: full
strategy:
matrix:
# os: [ubuntu-latest, macos-latest]
os: [macos-latest]
steps:
- uses: actions/checkout@v2
- name: Install GNU tar
if: runner.os == 'macOS'
run: |
brew install gnu-tar
# echo "::add-path::/usr/local/opt/gnu-tar/libexec/gnubin"
echo "/usr/local/opt/gnu-tar/libexec/gnubin" >> $GITHUB_PATH
- name: Install Rust nightly
uses: actions-rs/toolchain@v1
with:
profile: minimal
- name: Build release
shell: bash
run: |
cd build
./build-host-release
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: Releases
path: build/release/*
build-windows:
runs-on: windows-latest
env:
RUSTFLAGS: "-Ctarget-feature=+crt-static"
RUST_BACKTRACE: full
steps:
- uses: actions/checkout@v2
- name: Install Rust nightly
uses: actions-rs/toolchain@v1
with:
profile: minimal
- name: Build release
run: |
cd build
pwsh build-host-release.ps1
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: Releases
path: build/release/*

View File

@@ -2,6 +2,7 @@
[![Build & Test](https://github.com/shadowsocks/shadowsocks-rust/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/shadowsocks/shadowsocks-rust/actions/workflows/build-and-test.yml)
[![Build Releases](https://github.com/shadowsocks/shadowsocks-rust/actions/workflows/build-release.yml/badge.svg)](https://github.com/shadowsocks/shadowsocks-rust/actions/workflows/build-release.yml)
[![Build Nightly Releases](https://github.com/shadowsocks/shadowsocks-rust/actions/workflows/build-nightly-release.yml/badge.svg)](https://github.com/shadowsocks/shadowsocks-rust/actions/workflows/build-nightly-release.yml)
[![License](https://img.shields.io/github/license/zonyitoo/shadowsocks-rust.svg)](https://github.com/zonyitoo/shadowsocks-rust)
[![crates.io](https://img.shields.io/crates/v/shadowsocks-rust.svg)](https://crates.io/crates/shadowsocks-rust)
[![Release](https://img.shields.io/github/release/shadowsocks/shadowsocks-rust.svg)](https://github.com/shadowsocks/shadowsocks-rust/releases)