Skip to content

Commit

Permalink
version 0.4.3
Browse files Browse the repository at this point in the history
  • Loading branch information
huacnlee committed Jun 28, 2021
1 parent a7ec0c4 commit 0e1ff05
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 6 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Continuous Deployment

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

jobs:
publish:
name: Publishing for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
rust: [stable]
include:
- os: macos-latest
artifact_prefix: macos
target: x86_64-apple-darwin
binary_postfix: ""
- os: ubuntu-latest
artifact_prefix: linux
target: x86_64-unknown-linux-gnu
binary_postfix: ""
- os: windows-latest
artifact_prefix: windows
target: x86_64-pc-windows-msvc
binary_postfix: ".exe"

steps:
- name: Installing Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
- name: Installing needed macOS dependencies
if: matrix.os == 'macos-latest'
run: brew install openssl@1.1
- name: Installing needed Ubuntu dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y -qq pkg-config libssl-dev libxcb1-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev
- name: Checking out sources
uses: actions/checkout@v1
- name: Running cargo build
uses: actions-rs/cargo@v1
with:
command: build
toolchain: ${{ matrix.rust }}
args: --release --features="bin" --target ${{ matrix.target }}

- name: Packaging final binary
shell: bash
run: |
cd target/${{ matrix.target }}/release
BINARY_NAME=autocorrect
RELEASE_NAME=autocorrect
tar czvf $RELEASE_NAME.tar.gz $BINARY_NAME
if [[ ${{ runner.os }} == 'Windows' ]]; then
certutil -hashfile $RELEASE_NAME.tar.gz sha256 | grep -E [A-Fa-f0-9]{64} > $RELEASE_NAME.sha256
else
shasum -a 256 $RELEASE_NAME.tar.gz > $RELEASE_NAME.sha256
fi
- name: Releasing assets
uses: softprops/action-gh-release@v1
with:
files: |
target/${{ matrix.target }}/release/autocorrect-${{ matrix.artifact_prefix }}.tar.gz
target/${{ matrix.target }}/release/autocorrect-${{ matrix.artifact_prefix }}.sha256
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
File renamed without changes.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ license = "MIT"
name = "autocorrect"
readme = "README.md"
repository = "https://github.com/huacnlee/auto-correct.rs"
version = "0.4.3-alpha.0"
version = "0.4.4-alpha.0"

[lib]
name = "autocorrect"
Expand Down
9 changes: 4 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
use clap::{Arg, App, SubCommand};
use std::fs;
use autocorrect::{format, format_html};
use clap::{App, Arg, SubCommand};
use glob::glob;
use std::fs;

pub fn main() {
let matches = App::new("AutoCorrect")
.author("Jason Lee <huacnlee@gmail.com")
.version("0.3.0")
.version("0.4.3")
.about("Automatically add whitespace between CJK (Chinese, Japanese, Korean) and half-width characters (alphabetical letters, numerical digits and symbols).")
.subcommand(
SubCommand::with_name("format")
Expand Down Expand Up @@ -39,10 +39,9 @@ pub fn main() {

if matches.is_present("html") {
println!("{}", format(raw));
} else {
} else {
println!("{}", format_html(raw));
}
}
}

}

0 comments on commit 0e1ff05

Please sign in to comment.