Skip to content

chore: remove server work #25

chore: remove server work

chore: remove server work #25

Workflow file for this run

name: build
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"
jobs:
build:
permissions:
contents: write
name: build
runs-on: ${{ matrix.os }}
strategy:
matrix:
build: [linux, macos, windows]
include:
- build: linux
os: ubuntu-latest
rust: nightly
target: x86_64-unknown-linux-musl
archive-name: airnc-linux.tar.gz
- build: macos
os: macos-latest
rust: nightly
target: x86_64-apple-darwin
archive-name: airnc-macos.tar.gz
- build: macos-aarch64
os: macos-latest
rust: nightly
target: aarch64-apple-darwin
archive-name: airnc-macos-aarch64.tar.gz
- build: windows
os: windows-2019
rust: nightly-x86_64-msvc
target: x86_64-pc-windows-msvc
archive-name: airnc-windows.7z
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
profile: minimal
override: true
target: ${{ matrix.target }}
- name: Install musl(linux)
if: matrix.build == 'linux'
run: sudo apt-get update && sudo apt-get install pkg-config libssl-dev
- name: Build binary
run: cargo build --verbose --release --target ${{ matrix.target }} --package airnc
env:
RUST_BACKTRACE: 1
OPENSSL_DIR: /usr/bin/openssl
- name: Strip binary (linux and macos)
if: matrix.build == 'linux' || matrix.build == 'macos'
run: |
strip "target/${{ matrix.target }}/release/airnc"
- name: Build archive
shell: bash
run: |
mkdir archive
cp LICENSE README.md archive/
cd archive
if [ "${{ matrix.build }}" = "windows" ]; then
cp "../target/${{ matrix.target }}/release/airnc.exe" ./
7z a "${{ matrix.archive-name }}" LICENSE README.md airnc.exe
else
cp "../target/${{ matrix.target }}/release/airnc" ./
tar -czf "${{ matrix.archive-name }}" LICENSE README.md airnc
fi
- name: Upload archive
uses: actions/upload-artifact@v1
with:
name: ${{ matrix.archive-name }}
path: archive/${{ matrix.archive-name }}
- name: Release
uses: softprops/action-gh-release@v1
with:
draft: true
files: archive/${{ matrix.archive-name }}
server:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
override: true
target: x86_64-unknown-linux-musl
- name: Install musl
run: sudo apt-get install -y musl-tools
- name: Build binary
run: cargo build --verbose --release --package airnc-server
env:
RUST_BACKTRACE: 1
- name: Post to Alibaba Cloud
uses: easingthemes/[email protected]
env:
ARGS: "-avz --delete"
SOURCE: "target/release/airnc-server"
TARGET: "${{ secrets.REMOTE_TARGET }}"
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
REMOTE_USER: ${{ secrets.REMOTE_USER }}
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}