Skip to content

Commit

Permalink
ci(github): use github actions (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertohuertasm authored Dec 24, 2019
1 parent 11b7266 commit ef5215a
Show file tree
Hide file tree
Showing 8 changed files with 100 additions and 178 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
rust: [stable]
os: [ubuntu-latest, macOS-latest, windows-latest]
steps:
- name: Setup Rust
uses: hecrj/setup-rust-action@master
with:
rust-version: ${{ matrix.rust }}
components: rustfmt, clippy
- name: Checkout
uses: actions/checkout@v2
- name: Run cargo fmt
run: cargo fmt --all -- --check
- name: Run cargo clippy
run: cargo clippy --all -- -D clippy::pedantic -D clippy::nursery -D warnings
- name: Run tests
run: |
cargo test --verbose
66 changes: 66 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Release

on:
push:
tags:
- "v*.*.*"

jobs:
release:
runs-on: ${{ matrix.os }}
strategy:
matrix:
rust: [stable]
os: [ubuntu-latest, macOS-latest, windows-latest]
include:
- os: ubuntu-latest
rust: stable
artifact_name: microserver
asset_name: microserver_linux.gz
- os: macOS-latest
rust: stable
artifact_name: microserver
asset_name: microserver_osx.gz
- os: windows-latest
rust: stable
artifact_name: microserver.exe
asset_name: microserver_windows.gz
steps:
- name: Setup Rust
uses: hecrj/setup-rust-action@master
with:
rust-version: stable
- name: Checkout
uses: actions/checkout@v2
- name: Build artifacts
shell: bash
run: |
echo "Building the project"
cargo build --release
echo "Preparing the artifact"
chmod +x "target/release/${{ matrix.artifact_name }}"
gzip -k -f "target/release/${{ matrix.artifact_name }}"
echo "moving target/release/${{ matrix.artifact_name }}.gz to ${{ matrix.asset_name }}"
mv "target/release/${{ matrix.artifact_name }}.gz" "${{ matrix.asset_name }}"
- name: Publishing to GitHub release
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ matrix.asset_name }}
asset_name: ${{ matrix.asset_name }}
tag: ${{ github.ref }}

crates:
runs-on: ubuntu-latest
needs: [release]
steps:
- name: Setup Rust
uses: hecrj/setup-rust-action@master
with:
rust-version: stable
- name: Checkout
uses: actions/checkout@v2
- name: Publish to crates.io
run: |
cargo login ${{secrets.crates_key}}
cargo publish
40 changes: 0 additions & 40 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "microserver"
description = "Simple ad-hoc server with SPA support based on Warp!. Excellent for testing React, Angular, Vue apps and the like."
version = "0.1.5"
version = "0.1.6"
authors = ["Roberto Huertas <[email protected]>"]
edition = "2018"
license = "MIT"
Expand Down
132 changes: 0 additions & 132 deletions azure-pipelines.yml

This file was deleted.

3 changes: 0 additions & 3 deletions run.sh

This file was deleted.

1 change: 0 additions & 1 deletion rustfmt.toml

This file was deleted.

0 comments on commit ef5215a

Please sign in to comment.