-
Notifications
You must be signed in to change notification settings - Fork 2
98 lines (83 loc) · 2.98 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: Build
on:
push:
branches: [master]
paths:
- "Cargo.toml"
- "src/**"
- "ts/**"
- ".github/workflows/**"
- "deno.jsonc"
jobs:
build:
name: ${{ matrix.kind }} ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 15
strategy:
matrix:
os: [macOS-latest, ubuntu-latest, windows-latest]
env:
GH_ACTIONS: true
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
DENO_BUILD_MODE: release
steps:
- name: Clone repository
uses: actions/checkout@v3
- name: Setup deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.x
# TODO: Replace this with actions-rs
- name: Setup rust
# When rustup is updated, it tries to replace its binary, which on Windows is somehow locked.
# This can result in the CI failure, see: https://github.com/rust-lang/rustup/issues/3029
run: |
rustup set auto-self-update disable
rustup toolchain install stable --profile minimal
- name: Install x86_64 AND aarch64 targets (mac)
if: matrix.os == 'macOS-latest'
run: |
rustup target install x86_64-apple-darwin
rustup target install aarch64-apple-darwin
- name: Setup rust-cache
uses: Swatinem/rust-cache@v2.2.0
- name: Install required build packages (linux)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install libdbus-1-dev pkg-config libdbus-1-3
- name: Log versions
run: |
deno --version
rustc --version
cargo --version
- name: Build (linux, windows)
if: matrix.os == 'ubuntu-latest' || matrix.os == 'windows-latest'
run: deno task build:release
- name: Build (macos x86_64)
if: matrix.os == 'macOS-latest'
run: |
deno task build:release --target x86_64-apple-darwin
cp ./target/x86_64-apple-darwin/release/libdeno_notify.dylib ./target/x86_64-apple-darwin/release/libdeno_notify.x86_64.dylib
- name: Build (macos aarch64)
if: matrix.os == 'macOS-latest'
run: |
deno task build:release --target aarch64-apple-darwin
cp ./target/aarch64-apple-darwin/release/libdeno_notify.dylib ./target/aarch64-apple-darwin/release/libdeno_notify.aarch64.dylib
# - name: Run tests
# env:
# NOTIFY_PLUGIN_URL: ./target/release/
# run: deno test --unstable --allow-all ./tests/*.ts
- name: Release Plugin
uses: softprops/action-gh-release@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: "deno_notify release"
draft: true
files: |
./target/x86_64-apple-darwin/release/libdeno_notify.x86_64.dylib
./target/aarch64-apple-darwin/release/libdeno_notify.aarch64.dylib
./target/release/libdeno_notify.so
./target/release/deno_notify.dll