docs: rust.yml
This commit is contained in:
parent
6a7579e18b
commit
d2376e6d13
1 changed files with 44 additions and 26 deletions
70
.github/workflows/rust.yml
vendored
70
.github/workflows/rust.yml
vendored
|
@ -1,40 +1,58 @@
|
||||||
name: Rust
|
name: Rust
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ "main" ]
|
branches: [ "main" ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ "main" ]
|
branches: [ "main" ]
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CARGO_TERM_COLOR: always
|
CARGO_TERM_COLOR: always
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Build Linux x86
|
||||||
|
run: cargo build --release
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
- uses: actions-rs/cargo@v1
|
||||||
permissions:
|
name: Build Windows x86
|
||||||
contents: write
|
with:
|
||||||
steps:
|
use-cross: true
|
||||||
- uses: actions/checkout@v3
|
command: build
|
||||||
- name: Build
|
args: --release --target x86_64-pc-windows-msvc
|
||||||
run: cargo build --release
|
|
||||||
|
|
||||||
- name: Run tests
|
|
||||||
run: cargo test --verbose
|
|
||||||
|
|
||||||
- name: Set short git commit SHA
|
- uses: actions-rs/cargo@v1
|
||||||
id: vars
|
name: Build Apple x86
|
||||||
run: |
|
with:
|
||||||
calculatedSha=$(git rev-parse --short ${{ github.sha }})
|
use-cross: true
|
||||||
echo "::set-output name=short_sha::$calculatedSha"
|
command: build
|
||||||
|
args: --release --target x86_64-apple-darwin
|
||||||
|
|
||||||
- name: ${{ steps.vars.outputs.short_sha }}
|
|
||||||
uses: softprops/action-gh-release@v0.1.15
|
- name: Run tests
|
||||||
with:
|
run: cargo test --verbose
|
||||||
tag_name: ${{ steps.vars.outputs.short_sha }}
|
|
||||||
generate_release_notes: true
|
- name: Set short git commit SHA
|
||||||
files: target/release/rust-tcp-file-transfer
|
id: vars
|
||||||
|
run: |
|
||||||
|
calculatedSha=$(git rev-parse --short ${{ github.sha }})
|
||||||
|
echo "::set-output name=short_sha::$calculatedSha"
|
||||||
|
|
||||||
|
- name: ${{ steps.vars.outputs.short_sha }}
|
||||||
|
uses: softprops/action-gh-release@v0.1.15
|
||||||
|
with:
|
||||||
|
tag_name: ${{ steps.vars.outputs.short_sha }}
|
||||||
|
generate_release_notes: true
|
||||||
|
files: |
|
||||||
|
target/release/rust-tcp-file-transfer
|
||||||
|
target/*windows*/release/rust-tcp-file-transfer.exe
|
||||||
|
target/*apple*/release/rust-tcp-file-transfer
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue