forked from tuic-protocol/tuic
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
windows gnu disabled due to cross-rs/cross#1453
- Loading branch information
iHsin
committed
Mar 23, 2024
1 parent
914f6cb
commit c0fc187
Showing
3 changed files
with
419 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,209 @@ | ||
name: binary-release | ||
|
||
on: | ||
push: | ||
branches: | ||
- dev | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
PACKAGE: "tuic-server" | ||
PACKAGE2: "tuic-client" | ||
|
||
jobs: | ||
compile: | ||
name: Compile | ||
permissions: | ||
contents: write | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
include: | ||
# Linux | ||
- os: ubuntu-latest | ||
target: x86_64-unknown-linux-gnu | ||
release-name: x86_64-linux | ||
cross: true | ||
file-ext: "" | ||
extra-args: "" | ||
- os: ubuntu-latest | ||
target: x86_64-unknown-linux-musl | ||
release-name: x86_64-linux-musl | ||
cross: true | ||
file-ext: "" | ||
extra-args: "" | ||
- os: ubuntu-latest | ||
target: i686-unknown-linux-gnu | ||
release-name: i686-linux | ||
cross: true | ||
file-ext: "" | ||
extra-args: "" | ||
- os: ubuntu-latest | ||
target: i686-unknown-linux-musl | ||
release-name: i686-linux-musl | ||
cross: true | ||
file-ext: "" | ||
extra-args: "" | ||
# Linux arm | ||
- os: ubuntu-latest | ||
target: aarch64-unknown-linux-gnu | ||
release-name: aarch64-linux | ||
cross: true | ||
file-ext: "" | ||
extra-args: "" | ||
- os: ubuntu-latest | ||
target: aarch64-unknown-linux-musl | ||
release-name: aarch64-linux-musl | ||
cross: true | ||
file-ext: "" | ||
extra-args: "" | ||
- os: ubuntu-latest | ||
target: armv7-unknown-linux-gnueabi | ||
release-name: armv7-linux | ||
cross: true | ||
file-ext: "" | ||
extra-args: "" | ||
- os: ubuntu-latest | ||
target: armv7-unknown-linux-gnueabihf | ||
release-name: armv7-linux-hf | ||
cross: true | ||
file-ext: "" | ||
extra-args: "" | ||
- os: ubuntu-latest | ||
target: armv7-unknown-linux-musleabi | ||
release-name: armv7-linux-musl | ||
cross: true | ||
file-ext: "" | ||
extra-args: "" | ||
- os: ubuntu-latest | ||
target: armv7-unknown-linux-musleabihf | ||
release-name: armv7-linux-muslhf | ||
cross: true | ||
file-ext: "" | ||
extra-args: "" | ||
|
||
# Windows | ||
- os: windows-latest | ||
target: x86_64-pc-windows-msvc | ||
release-name: x86_64-windows | ||
cross: false | ||
file-ext: ".exe" | ||
extra-args: "" | ||
- os: windows-latest | ||
target: i686-pc-windows-msvc | ||
release-name: i686-windows | ||
cross: true | ||
file-ext: ".exe" | ||
extra-args: "" | ||
|
||
# Windows GNU | ||
# - os: ubuntu-latest | ||
# target: x86_64-pc-windows-gnu | ||
# release-name: x86_64-windows-gnu | ||
# cross: true | ||
# file-ext: ".exe" | ||
# extra-args: "" | ||
|
||
# MacOSX | ||
- os: macos-latest | ||
target: x86_64-apple-darwin | ||
release-name: x86_64-darwin | ||
cross: false | ||
file-ext: "" | ||
extra-args: "" | ||
- os: macos-latest | ||
target: aarch64-apple-darwin | ||
release-name: aarch64-darwin | ||
cross: true | ||
file-ext: "" | ||
extra-args: "" | ||
|
||
# FreeBSD | ||
- os: ubuntu-latest | ||
target: x86_64-unknown-freebsd | ||
release-name: x86_64-freebsd | ||
cross: true | ||
file-ext: "" | ||
extra-args: "" | ||
|
||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
key: ${{ matrix.target }}-release-${{ hashFiles('**/Cargo.toml') }} | ||
restore-keys: | | ||
${{ matrix.target }}-release | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: nightly | ||
target: ${{ matrix.target }} | ||
|
||
# Build client and server separately | ||
# But i gotta say that's ugly | ||
# Blame me that can't figure out how GHA matrix works | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
use-cross: ${{ matrix.cross }} | ||
command: build | ||
args: --release -p ${{ env.PACKAGE }} --target ${{ matrix.target }} ${{ matrix.extra-args }} | ||
|
||
- name: Rename binary | ||
run: mv target/${{ matrix.target }}/release/${{ env.PACKAGE }}${{ matrix.file-ext }} ${{ env.PACKAGE }}-${{ matrix.release-name }}${{ matrix.file-ext }} | ||
|
||
- name: Upload binaries | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: compile | ||
path: ${{ env.PACKAGE }}-${{ matrix.release-name }}${{ matrix.file-ext }} | ||
|
||
- uses: actions-rs/cargo@v1 | ||
with: | ||
use-cross: ${{ matrix.cross }} | ||
command: build | ||
args: --release -p ${{ env.PACKAGE2 }} --target ${{ matrix.target }} ${{ matrix.extra-args }} | ||
|
||
- name: Rename binary | ||
run: mv target/${{ matrix.target }}/release/${{ env.PACKAGE2 }}${{ matrix.file-ext }} ${{ env.PACKAGE2 }}-${{ matrix.release-name }}${{ matrix.file-ext }} | ||
|
||
- name: Upload binaries | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: compile | ||
path: ${{ env.PACKAGE2 }}-${{ matrix.release-name }}${{ matrix.file-ext }} | ||
|
||
release: | ||
name: Release | ||
needs: [compile] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Download binaries | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: compile | ||
path: ./packages | ||
|
||
- name: Github release | ||
uses: "marvinpinto/action-automatic-releases@latest" | ||
with: | ||
repo_token: "${{ secrets.GITHUB_TOKEN }}" | ||
automatic_release_tag: latest | ||
prerelease: true | ||
title: "Bleeding edge/前沿版本" | ||
files: | | ||
packages/* | ||
LICENSE |
Oops, something went wrong.