Skip to content

Commit

Permalink
chore: add ci
Browse files Browse the repository at this point in the history
  • Loading branch information
sno2 authored Nov 21, 2021
1 parent 6617746 commit a6e4058
Showing 1 changed file with 82 additions and 0 deletions.
82 changes: 82 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# modified from deno-dom: https://github.com/b-fuze/deno-dom/blob/master/.github/workflows/main.yml

name: ci

on:
push:
paths:
- "Cargo.toml"
- "src/**"
- ".github/workflows/**"
pull_request:
paths:
- "Cargo.toml"
- "src/**"
- ".github/workflows/**"

jobs:
build:
name: ${{ matrix.kind }} ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
matrix:
os: [macOS-latest, windows-latest, ubuntu-latest]

env:
GH_ACTIONS: true
RUST_BACKTRACE: full
DENO_BUILD_MODE: release

steps:
- name: Clone repository
uses: actions/checkout@v1

- name: Install rust
uses: hecrj/setup-rust-action@v1
with:
rust-version: "1.56.1"

- name: Log versions
run: |
rustc --version
cargo --version
- name: Cache cargo registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}

- name: Cache cargo index
uses: actions/cache@v1
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}

- name: Cache cargo build
uses: actions/cache@v1
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}

- name: Remove Some Cache
if: matrix.os == 'windows-latest'
run: |
rm target/release/gn_root -Recurse -ErrorAction Ignore
rm target/debug/gn_root -Recurse -ErrorAction Ignore
- name: Build
env:
RUST_BACKTRACE: 1
run: cargo clean && cargo build --release

- name: Release Plugin
uses: softprops/action-gh-release@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: "release draft"
draft: true
files: |
target/release/libbertml.dylib
target/release/bertml.dll
target/release/libbertml.so

0 comments on commit a6e4058

Please sign in to comment.