mirror of
https://github.com/dndx/phantun.git
synced 2025-01-18 13:59:30 +08:00
ci(actions) auto release artifacts
This commit is contained in:
parent
e6bc75951b
commit
96c967a498
46
.github/workflows/release.yml
vendored
Normal file
46
.github/workflows/release.yml
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
name: Build Releases
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- v*.*.*
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
build-cross:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
RUST_BACKTRACE: full
|
||||
strategy:
|
||||
matrix:
|
||||
target:
|
||||
- x86_64-unknown-linux-gnu
|
||||
- armv7-unknown-linux-gnueabihf
|
||||
|
||||
steps:
|
||||
- name: Set RELEASE_VERSION env
|
||||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
target: ${{ matrix.target }}
|
||||
override: true
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
use-cross: true
|
||||
command: build
|
||||
args: --release --target ${{ matrix.target }}
|
||||
- name: Rename artifacts and compress
|
||||
run: |
|
||||
cd target/${{ matrix.target }}/release
|
||||
mv client phantun_client
|
||||
mv server phantun_server
|
||||
zip phantun_$RELEASE_VERSION_${{ matrix.target }}.zip phantun_client phantun_server
|
||||
|
||||
- name: Upload Github Assets
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
files: target/${{ matrix.target }}/release/*.zip
|
||||
prerelease: ${{ contains(github.ref, '-') }}
|
Loading…
x
Reference in New Issue
Block a user