move from travis to github actions
This commit is contained in:
parent
a671e47edf
commit
4fcfe1e5da
3 changed files with 73 additions and 39 deletions
34
.github/workflows/build.yml
vendored
Normal file
34
.github/workflows/build.yml
vendored
Normal file
|
@ -0,0 +1,34 @@
|
|||
name: build test lint
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- rust: stable
|
||||
- rust: nightly
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: ${{ matrix.rust }}
|
||||
|
||||
- name: build
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: build
|
||||
|
||||
- name: test
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: test
|
||||
|
||||
- name: lint
|
||||
uses: actions-rs/clippy-check@v1
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
39
.github/workflows/release.yml
vendored
Normal file
39
.github/workflows/release.yml
vendored
Normal file
|
@ -0,0 +1,39 @@
|
|||
name: Make a release
|
||||
|
||||
on:
|
||||
repository_dispatch:
|
||||
types: [tag-created]
|
||||
|
||||
jobs:
|
||||
release:
|
||||
name: Build and Release
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
artifact_name: http-server
|
||||
asset_name: http-server-$tag-linux-amd64.zip
|
||||
- os: macos-latest
|
||||
artifact_name: http-server
|
||||
asset_name: http-server-$tag-macos-amd64.zip
|
||||
- os: windows-latest
|
||||
artifact_name: http-server.exe
|
||||
asset_name: http-server-$tag-windows.zip
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Build project
|
||||
run: cargo build --release --locked
|
||||
|
||||
- name: Pre-release
|
||||
run: |
|
||||
strip target/release/${{ matrix.artifact_name }}
|
||||
zip ${{ matrix.asset_name }} -j target/release/${{ matrix.artifact_name }}
|
||||
|
||||
- name: Upload binary to release
|
||||
uses: svenstaro/upload-release-action@v1-release
|
||||
with:
|
||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
file: ${{ matrix.asset_name }}
|
||||
tag: ${{ github.event.client_payload.new_version }}
|
39
.travis.yml
39
.travis.yml
|
@ -1,39 +0,0 @@
|
|||
language: rust
|
||||
rust: stable
|
||||
cache: cargo
|
||||
sudo: false
|
||||
|
||||
env:
|
||||
global:
|
||||
- PROJECT_NAME=http-server
|
||||
|
||||
matrix:
|
||||
include:
|
||||
- os: osx
|
||||
env: TARGET=x86_64-apple-darwin
|
||||
- os: linux
|
||||
env: TARGET=x86_64-unknown-linux-gnu
|
||||
- os: windows
|
||||
env: TARGET=x86_64-pc-windows-msvc SUFFIX=.exe
|
||||
|
||||
script:
|
||||
- cargo build ${TRAVIS_TAG:+--release} --target $TARGET
|
||||
- size target/$TARGET/*/${PROJECT_NAME}${SUFFIX}
|
||||
|
||||
before_deploy:
|
||||
- if [ "$TRAVIS_OS_NAME" = "windows" ]; then choco install zip ; fi
|
||||
- strip "target/$TARGET/release/${PROJECT_NAME}${SUFFIX}"
|
||||
- zip ${PROJECT_NAME}-${TRAVIS_TAG}-${TARGET}.zip -j "target/$TARGET/release/${PROJECT_NAME}${SUFFIX}"
|
||||
|
||||
deploy:
|
||||
provider: releases
|
||||
api_key: $GIT_TOKEN
|
||||
file: ${PROJECT_NAME}-${TRAVIS_TAG}-${TARGET}.zip
|
||||
# don't delete the artifacts from previous phases
|
||||
skip_cleanup: true
|
||||
overwrite: true
|
||||
# deploy when a new tag is pushed
|
||||
on:
|
||||
# channel to use to produce the release artifacts
|
||||
condition: $TRAVIS_RUST_VERSION = stable
|
||||
tags: true
|
Loading…
Add table
Reference in a new issue