-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 92aa4a9
Showing
14 changed files
with
2,711 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
set -ex | ||
|
||
main() { | ||
local tag=$(git tag --points-at HEAD) | ||
local src=$(pwd) \ | ||
stage= | ||
|
||
if [ "$OS_NAME" = "macOS-latest" ]; then | ||
stage=$(mktemp -d -t tmp) | ||
else | ||
stage=$(mktemp -d) | ||
fi | ||
|
||
cp target/$TARGET/release/obs_livesplit_one.dll $stage/obs-livesplit-one.dll 2>/dev/null || : | ||
cp target/$TARGET/release/libobs_livesplit_one.so $stage/libobs_livesplit_one.so 2>/dev/null || : | ||
cp target/$TARGET/release/libobs_livesplit_one.dylib $stage/libobs_livesplit_one.dylib 2>/dev/null || : | ||
|
||
cd $stage | ||
if [ "$OS_NAME" = "windows-latest" ]; then | ||
7z a $src/obs-livesplit-one-$tag-$TARGET.zip * | ||
else | ||
tar czf $src/obs-livesplit-one-$tag-$TARGET.tar.gz * | ||
fi | ||
cd $src | ||
|
||
rm -rf $stage | ||
} | ||
|
||
main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
set -ex | ||
|
||
main() { | ||
local cargo=cross | ||
if [ "$SKIP_CROSS" = "skip" ]; then | ||
cargo=cargo | ||
fi | ||
local release_flag="" | ||
if [ "$IS_DEPLOY" = "true" ]; then | ||
release_flag="--release" | ||
fi | ||
|
||
$cargo build --target $TARGET $release_flag $FEATURES | ||
} | ||
|
||
main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
name: Rust | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- 'master' | ||
tags: | ||
- '*' | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
label: | ||
- Windows x86_64 | ||
# - Linux x86_64 | ||
# - macOS x86_64 | ||
|
||
include: | ||
- label: Windows x86_64 | ||
target: x86_64-pc-windows-msvc | ||
os: windows-latest | ||
cross: skip | ||
|
||
# - label: Linux x86_64 | ||
# target: x86_64-unknown-linux-gnu | ||
# os: ubuntu-latest | ||
# cross: skip | ||
|
||
# - label: macOS x86_64 | ||
# target: x86_64-apple-darwin | ||
# os: macOS-latest | ||
# cross: skip | ||
|
||
steps: | ||
- name: Checkout Commit | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Rust | ||
uses: hecrj/setup-rust-action@v1 | ||
with: | ||
rust-version: ${{ matrix.toolchain || 'stable' }} | ||
|
||
- name: Install Target | ||
if: matrix.install_target != '' | ||
run: rustup target add ${{ matrix.target }} | ||
|
||
- name: Install cross | ||
if: matrix.cross == '' | ||
run: sh .github/workflows/install.sh | ||
env: | ||
OS_NAME: ${{ matrix.os }} | ||
|
||
- name: Build Shared Library | ||
if: matrix.dylib == '' | ||
run: sh .github/workflows/build_shared.sh | ||
env: | ||
TARGET: ${{ matrix.target }} | ||
SKIP_CROSS: ${{ matrix.cross }} | ||
IS_DEPLOY: ${{ startsWith(github.ref, 'refs/tags/') && (matrix.release_anyway != '' || !(startsWith(matrix.toolchain, 'nightly') || startsWith(matrix.toolchain, 'beta'))) }} | ||
FEATURES: ${{ matrix.features }} | ||
|
||
- name: Prepare Release | ||
if: startsWith(github.ref, 'refs/tags/') && matrix.release == '' | ||
shell: bash | ||
run: .github/workflows/before_deploy.sh | ||
env: | ||
OS_NAME: ${{ matrix.os }} | ||
TARGET: ${{ matrix.target }} | ||
|
||
- name: Release | ||
if: startsWith(github.ref, 'refs/tags/') && matrix.release == '' | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: obs-livesplit-one-*.* | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
clippy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Commit | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Rust | ||
uses: hecrj/setup-rust-action@v1 | ||
with: | ||
components: clippy | ||
|
||
- name: Run Clippy | ||
run: cargo clippy --all-features | ||
|
||
format: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Commit | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Rust | ||
uses: hecrj/setup-rust-action@v1 | ||
with: | ||
components: rustfmt | ||
|
||
- name: Run cargo fmt | ||
run: cargo fmt -- --check || true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/target |
Oops, something went wrong.