Skip to content

Commit

Permalink
Add CI/CD
Browse files Browse the repository at this point in the history
Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
  • Loading branch information
Caellian committed Jun 21, 2024
1 parent 3504a7b commit 6ee9c1e
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 5 deletions.
79 changes: 79 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Build

on:
push:
branches:
- trunk

jobs:
build:
name: Build - ${{ matrix.platform.release_for }}
runs-on: ${{ matrix.platform.os }}
strategy:
matrix:
platform:
- release_for: ARM64 Linux
os: ubuntu-latest
target: aarch64-unknown-linux-gnu
bin: wiki-extractor
name: wiki-extractor-gnu-linux-aarch64
- release_for: 32-bit MSVC
os: windows-latest
target: i686-pc-windows-msvc
bin: wiki-extractor.exe
name: wiki-extractor-windows-i686.exe
- release_for: 32-bit Linux
os: ubuntu-latest
target: i686-unknown-linux-gnu
bin: wiki-extractor
name: wiki-extractor-gnu-linux-i686
- release_for: 64-bit macOS
os: macos-latest
target: x86_64-apple-darwin
bin: wiki-extractor
name: wiki-extractor-darwin-x86_64
- release_for: 64-bit MSVC
os: windows-latest
target: x86_64-pc-windows-msvc
bin: wiki-extractor.exe
name: wiki-extractor-windows-x86_64.exe
- release_for: 64-bit Linux
os: ubuntu-latest
target: x86_64-unknown-linux-gnu
bin: wiki-extractor
name: wiki-extractor-gnu-linux-x86_64
- release_for: 64-bit FreeBSD
os: ubuntu-latest
target: x86_64-unknown-freebsd
bin: wiki-extractor
name: wiki-extractor-freebsd-x86_64

steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
- uses: clechasseur/rs-cargo@v2
with:
command: build
args: --release --all-features
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.platform.name }}
path: target/release/${{ matrix.platform.bin }}
release:
runs-on: ubuntu-latest
needs: build
if: startsWith(github.ref, 'refs/tags/')

steps:
- name: Download All Artifacts
uses: actions/download-artifact@v4

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: |
./wiki-extractor-*
6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "wiki-extractor"
version = "0.1.5"
version = "0.1.6"
edition = "2021"
description = "Wikipedia dump download and cleanup tool"
authors = ["Tin Švagelj <tin.svagelj@live.com>"]
Expand Down Expand Up @@ -35,3 +35,7 @@ itertools = "0.13"

serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"

[profile.release]
strip = "symbols"
lto = true
3 changes: 1 addition & 2 deletions src/input/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use std::{
fmt::Display,
fs::File,
io::{ErrorKind, Seek},
os::unix::ffi::OsStrExt,
path::{Path, PathBuf},
str::FromStr,
};
Expand Down Expand Up @@ -235,7 +234,7 @@ impl TryFrom<&Path> for FileName {
},
)
})?
.as_bytes()
.as_encoded_bytes()
.to_vec(),
)
.map_err(|it| std::io::Error::new(ErrorKind::InvalidData, it.utf8_error()))?,
Expand Down
4 changes: 2 additions & 2 deletions src/output/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ use std::{
collections::HashSet,
fs::File,
io::{ErrorKind, Write as _},
path::{Path, PathBuf}, sync::Arc, future::IntoFuture,
path::{Path, PathBuf}, sync::Arc,
};

use futures::{Future, future::BoxFuture};
use futures::future::BoxFuture;
use itertools::Itertools;
use parse_wiki_text_2::Configuration as MediawikiConfig;

Expand Down

0 comments on commit 6ee9c1e

Please sign in to comment.