Buttplug sex toy control library
1name: Intiface Engine Build
2
3on:
4 push:
5 branches:
6 - main
7 - dev
8 - ci
9
10concurrency:
11 group: ${{ github.head_ref || github.ref }}
12 cancel-in-progress: true
13
14jobs:
15 build-stable:
16 runs-on: ${{ matrix.os }}
17 strategy:
18 matrix:
19 os: [ubuntu-latest, macos-latest, windows-latest]
20 steps:
21 - uses: actions/checkout@v2
22 - name: Fix ~/.cargo directory permissions
23 if: startsWith(matrix.os, 'ubuntu') || startsWith(matrix.os, 'macos')
24 run: sudo chown -R $(whoami):$(id -ng) ~/.cargo/
25 - name: Update package list
26 if: startsWith(matrix.os, 'ubuntu')
27 run: sudo apt-get -y update
28 - name: Install required packages
29 if: startsWith(matrix.os, 'ubuntu')
30 run: sudo apt-get -y install libudev-dev libusb-1.0-0-dev libdbus-1-dev
31 - name: Cache cargo registry
32 uses: actions/cache@v1
33 with:
34 path: ~/.cargo/registry
35 key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('.github/workflows/cache_version') }}
36 - name: Cache cargo build
37 uses: actions/cache@v1
38 with:
39 path: target
40 key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('.github/workflows/cache_version') }}
41 - name: Rust toolchain fetch
42 uses: actions-rs/toolchain@v1
43 with:
44 profile: minimal
45 toolchain: nightly
46 override: true
47 components: rustfmt, clippy
48 - name: Formatting check
49 continue-on-error: true
50 uses: actions-rs/cargo@v1
51 with:
52 command: fmt
53 args: --all -- --check
54 - name: Build Release
55 run: cargo build --release
56 - name: Copy executable (Linux, MacOS)
57 if: startsWith(matrix.os, 'ubuntu') || startsWith(matrix.os, 'macos')
58 run: |
59 mkdir ci-output-release
60 cp target/release/intiface-engine ci-output-release/intiface-engine
61 - name: Copy executable (Windows)
62 if: startsWith(matrix.os, 'windows')
63 run: |
64 mkdir ci-output-release
65 copy target\release\intiface-engine.exe ci-output-release\intiface-engine.exe
66 - name: Upload artifacts (release)
67 uses: actions/upload-artifact@v4
68 with:
69 name: intiface-engine-${{ runner.os }}-release
70 path: ci-output-release
71 build-v4:
72 runs-on: windows-latest
73 steps:
74 - uses: actions/checkout@v2
75 - name: Cache cargo registry
76 uses: actions/cache@v1
77 with:
78 path: ~/.cargo/registry
79 key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('.github/workflows/cache_version') }}
80 - name: Cache cargo build
81 uses: actions/cache@v1
82 with:
83 path: target
84 key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('.github/workflows/cache_version') }}
85 - name: Rust toolchain fetch
86 uses: actions-rs/toolchain@v1
87 with:
88 profile: minimal
89 toolchain: nightly
90 override: true
91 components: rustfmt, clippy
92 - name: Formatting check
93 continue-on-error: true
94 uses: actions-rs/cargo@v1
95 with:
96 command: fmt
97 args: --all -- --check
98 - name: Build Release
99 run: cargo build --release
100 - name: Copy executable (Windows)
101 run: |
102 mkdir ci-output-release
103 copy target\release\intiface-engine.exe ci-output-release\intiface-engine.exe
104 - name: Upload artifacts (release)
105 uses: actions/upload-artifact@v4
106 with:
107 name: intiface-engine-${{ runner.os }}-unstable-v4-release
108 path: ci-output-release
109 release:
110 name: Release artifacts
111 needs:
112 - build-stable
113 - build-v4
114 runs-on: ubuntu-latest
115 if: startsWith(github.ref, 'refs/tags/v')
116 steps:
117 - uses: actions/checkout@v2
118 - name: Download Artifact (Linux)
119 uses: actions/download-artifact@v4
120 with:
121 name: intiface-engine-Linux-release
122 - name: Download Artifact (Windows)
123 uses: actions/download-artifact@v4
124 with:
125 name: intiface-engine-Windows-release
126 - name: Download Artifact (Windows) (v4 Unstable)
127 uses: actions/download-artifact@v4
128 with:
129 name: intiface-engine-Windows-unstable-v4-release
130 - name: Download Artifact (MacOS)
131 uses: actions/download-artifact@v4
132 with:
133 name: intiface-engine-macOS-release
134 - name: Zip executables
135 # This follows the naming convention from C# and JS. Use -j to junk the
136 # directory structure.
137 run: |
138 zip -j intiface-engine-linux-x64-Release.zip intiface-engine-Linux-release/intiface-engine README.md CHANGELOG.md
139 zip -j intiface-engine-win-x64-Release.zip intiface-engine-Windows-release/intiface-engine.exe README.md CHANGELOG.md
140 zip -j intiface-engine-win-x64-unstable-v4-Release.zip intiface-engine-Windows-unstable-v4-release/intiface-engine.exe README.md CHANGELOG.md
141 zip -j intiface-engine-macos-x64-Release.zip intiface-engine-macOS-release/intiface-engine README.md CHANGELOG.md Info.plist
142 - name: Release
143 uses: softprops/action-gh-release@v1
144 if: startsWith(github.ref, 'refs/tags/')
145 with:
146 files: |
147 intiface-engine-linux-x64-Release.zip
148 intiface-engine-win-x64-Release.zip
149 intiface-engine-win-x64-unstable-v4-Release.zip
150 intiface-engine-macos-x64-Release.zip
151 README.md
152 CHANGELOG.md
153 env:
154 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}