Skip to content

Commit

Permalink
Setup Github CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ctison committed Mar 26, 2020
1 parent a7081fc commit b493667
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
40 changes: 40 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: CI/CD

on:
push:
branches: [master]
tags: [v*.*.*]
pull_request:
branches: [master]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout the source code
uses: actions/checkout@v2
- name: Build
uses: docker://rust:1.42.0-buster
with:
args: /bin/sh -c "cargo test && cargo build --release"
- name: Create a Release
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body: ""
draft: false
- name: Upload a Release Asset
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./target/release/base
asset_name: base-linux-amd64
asset_content_type: application/octet-stream
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use lib::base_to_base;

fn main() {
let matches = clap_app!(base_converter =>
(version: "1.0")
(version: "1.0.0")
(about: "Convert numbers from any to any base")
(@arg NUMBER: +required "Number to be converted from FROM_BASE to TO_BASE")
(@arg FROM_BASE: +required "Base in which NUMBER is converted from")
Expand Down

0 comments on commit b493667

Please sign in to comment.