ops: github actions
This commit is contained in:
parent
576297d2bc
commit
95342c82c8
3 changed files with 166 additions and 0 deletions
22
.github/workflows/dev.yml
vendored
Normal file
22
.github/workflows/dev.yml
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
name: Rust Dev Branch -> Build & Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "dev" ]
|
||||
pull_request:
|
||||
branches: [ "dev" ]
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
build_linux:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Build
|
||||
run: cargo build --release --verbose
|
||||
- name: Run tests
|
||||
run: cargo test --verbose
|
44
.github/workflows/pr_main.yml
vendored
Normal file
44
.github/workflows/pr_main.yml
vendored
Normal file
|
@ -0,0 +1,44 @@
|
|||
name: Rust Main Branch Pull Request -> Build & Test
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
build_linux:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Build
|
||||
run: cargo build --release --verbose
|
||||
- name: Run tests
|
||||
run: cargo test --verbose
|
||||
|
||||
|
||||
build_windows:
|
||||
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Build
|
||||
run: cargo build --release --verbose
|
||||
- name: Run tests
|
||||
run: cargo test --verbose
|
||||
|
||||
|
||||
build_macos:
|
||||
|
||||
runs-on: macos-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Build
|
||||
run: cargo build --release --verbose
|
||||
- name: Run tests
|
||||
run: cargo test --verbose
|
100
.github/workflows/rust.yml
vendored
Normal file
100
.github/workflows/rust.yml
vendored
Normal file
|
@ -0,0 +1,100 @@
|
|||
name: Rust -> Build & Test & Release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
build_linux:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Build
|
||||
run: cargo build --release --verbose
|
||||
- name: Run tests
|
||||
run: cargo test --verbose
|
||||
|
||||
- name: Upload Linux Binary
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: rust_tcp_file_transfer_linux_x64_86
|
||||
path: target/release/*transfer
|
||||
|
||||
build_windows:
|
||||
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Build
|
||||
run: cargo build --release --verbose
|
||||
- name: Run tests
|
||||
run: cargo test --verbose
|
||||
|
||||
- name: Upload Windows Binary
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: rust_tcp_file_transfer_windows_x64_86
|
||||
path: target/release/*transfer.exe
|
||||
|
||||
build_macos:
|
||||
|
||||
runs-on: macos-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Build
|
||||
run: cargo build --release --verbose
|
||||
- name: Run tests
|
||||
run: cargo test --verbose
|
||||
|
||||
- name: Upload MacOS Binary
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: rust_tcp_file_transfer_macos_x64_86
|
||||
path: target/release/*transfer
|
||||
|
||||
release:
|
||||
needs: [build_linux, build_windows, build_macos]
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
- name: Forge a Folder
|
||||
run: mkdir Downloads
|
||||
working-directory: /home/runner/work/rust-tcp-file-transfer/rust-tcp-file-transfer/
|
||||
|
||||
- uses: actions/download-artifact@v3
|
||||
name: Download
|
||||
with:
|
||||
path: Downloads/
|
||||
|
||||
- name: Rename Binaries
|
||||
run: |
|
||||
mv Downloads/rust_tcp_file_transfer_linux_x64_86/rust-tcp-file-transfer Downloads/rust_tcp_file_transfer_linux_x64_86/rust-tcp-file-transfer-linux_x64_86
|
||||
mv Downloads/rust_tcp_file_transfer_windows_x64_86/rust-tcp-file-transfer.exe Downloads/rust_tcp_file_transfer_windows_x64_86/rust-tcp-file-transfer-windows_x64_86.exe
|
||||
mv Downloads/rust_tcp_file_transfer_macos_x64_86/rust-tcp-file-transfer Downloads/rust_tcp_file_transfer_macos_x64_86/rust-tcp-file-transfer-macos_x64_86
|
||||
|
||||
- name: Git Commit SHA
|
||||
id: vars
|
||||
run: |
|
||||
calculatedSha=$(git rev-parse --short ${{ github.sha }})
|
||||
echo "short_sha=$calculatedSha" >> $GITHUB_OUTPUT
|
||||
|
||||
- uses: softprops/action-gh-release@v0.1.15
|
||||
name: Release
|
||||
with:
|
||||
tag_name: ${{ steps.vars.outputs.short_sha }}
|
||||
generate_release_notes: true
|
||||
files: |
|
||||
Downloads/*linux*/*transfer*
|
||||
Downloads/*windows*/*transfer*
|
||||
Downloads/*macos*/*transfer*
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue