|
| 1 | +# modified from deno-dom: https://github.com/b-fuze/deno-dom/blob/master/.github/workflows/main.yml |
| 2 | + |
| 3 | +name: ci |
| 4 | + |
| 5 | +on: |
| 6 | + push: |
| 7 | + paths: |
| 8 | + - "Cargo.toml" |
| 9 | + - "src/**" |
| 10 | + - ".github/workflows/**" |
| 11 | + pull_request: |
| 12 | + paths: |
| 13 | + - "Cargo.toml" |
| 14 | + - "src/**" |
| 15 | + - ".github/workflows/**" |
| 16 | + |
| 17 | +jobs: |
| 18 | + build: |
| 19 | + name: ${{ matrix.kind }} ${{ matrix.os }} |
| 20 | + runs-on: ${{ matrix.os }} |
| 21 | + timeout-minutes: 60 |
| 22 | + strategy: |
| 23 | + matrix: |
| 24 | + os: [macOS-latest, windows-latest, ubuntu-latest] |
| 25 | + |
| 26 | + env: |
| 27 | + GH_ACTIONS: true |
| 28 | + RUST_BACKTRACE: full |
| 29 | + DENO_BUILD_MODE: release |
| 30 | + |
| 31 | + steps: |
| 32 | + - name: Clone repository |
| 33 | + uses: actions/checkout@v1 |
| 34 | + |
| 35 | + - name: Install rust |
| 36 | + uses: hecrj/setup-rust-action@v1 |
| 37 | + with: |
| 38 | + rust-version: "1.56.1" |
| 39 | + |
| 40 | + - name: Log versions |
| 41 | + run: | |
| 42 | + rustc --version |
| 43 | + cargo --version |
| 44 | + - name: Cache cargo registry |
| 45 | + uses: actions/cache@v1 |
| 46 | + with: |
| 47 | + path: ~/.cargo/registry |
| 48 | + key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} |
| 49 | + |
| 50 | + - name: Cache cargo index |
| 51 | + uses: actions/cache@v1 |
| 52 | + with: |
| 53 | + path: ~/.cargo/git |
| 54 | + key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} |
| 55 | + |
| 56 | + - name: Cache cargo build |
| 57 | + uses: actions/cache@v1 |
| 58 | + with: |
| 59 | + path: target |
| 60 | + key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} |
| 61 | + |
| 62 | + - name: Remove Some Cache |
| 63 | + if: matrix.os == 'windows-latest' |
| 64 | + run: | |
| 65 | + rm target/release/gn_root -Recurse -ErrorAction Ignore |
| 66 | + rm target/debug/gn_root -Recurse -ErrorAction Ignore |
| 67 | + - name: Build |
| 68 | + env: |
| 69 | + RUST_BACKTRACE: 1 |
| 70 | + run: cargo clean && cargo build --release |
| 71 | + |
| 72 | + - name: Release Plugin |
| 73 | + uses: softprops/action-gh-release@master |
| 74 | + env: |
| 75 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 76 | + with: |
| 77 | + tag_name: "release draft" |
| 78 | + draft: true |
| 79 | + files: | |
| 80 | + target/release/libbertml.dylib |
| 81 | + target/release/bertml.dll |
| 82 | + target/release/libbertml.so |
0 commit comments