Skip to content

Commit

Permalink
update build / workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
fcannizzaro committed Dec 25, 2023
1 parent dc49ea0 commit 968dde5
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 136 deletions.
43 changes: 2 additions & 41 deletions .github/workflows/build-plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
workflow_dispatch:

jobs:
build-win-plugin:
build-solo-mode:
runs-on: windows-latest
defaults:
run:
Expand All @@ -17,19 +17,7 @@ jobs:
- uses: actions-rs/[email protected]
with:
command: build
args: --manifest-path rust/Cargo.toml --release

- uses: actions-rs/[email protected]
with:
command: build
args: --manifest-path solo-mode-service/Cargo.toml --release

- name: Temporary store plugin
uses: actions/upload-artifact@v3
with:
name: com.dim.streamdeck.exe
path: ./rust/target/release/plugin.exe
retention-days: 10
args: --manifest-path solo-mode/Cargo.toml --release

- name: Temporary store install-sd-solo-enabler.exe
uses: actions/upload-artifact@v3
Expand All @@ -51,30 +39,3 @@ jobs:
name: service
path: ./solo-mode-service/target/release/sd-solo-enabler.exe
retention-days: 10

build-mac-plugin:
runs-on: macos-latest
defaults:
run:
working-directory: ./rust/
steps:
- uses: actions/checkout@v3
- uses: actions-rs/[email protected]
with:
toolchain: stable

- uses: actions-rs/[email protected]
with:
command: build
args: --manifest-path rust/Cargo.toml --release

- name: chmod +x
run: chmod +x ./target/release/plugin

- name: Temporary store plugin
uses: actions/upload-artifact@v3
with:
name: com.dim.streamdeck
path: ./rust/target/release/plugin
retention-days: 10

63 changes: 0 additions & 63 deletions .github/workflows/pr-build.yaml

This file was deleted.

43 changes: 13 additions & 30 deletions .github/workflows/publish-package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,59 +4,42 @@ on:

jobs:
package-plugin:
runs-on: windows-latest
runs-on: mac-latest
steps:
- uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20

- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
version: 7
run_install: false
version: 8
run_install: true

- name: Build property inspector
working-directory: ./property-inspector/
run: pnpm install && pnpm build

- uses: suisei-cn/[email protected]
id: distribution_tool
name: Download Elgato Distribution Tool
with:
url: "https://developer.elgato.com/documentation/stream-deck/distributiontool/DistributionToolWindows.zip"
target: .

- name: Extract DistributionTool.exe
run: 7z x "${{ steps.distribution_tool.outputs.filename }}"
run: pnpm build

- name: Download artifacts
uses: dawidd6/action-download-artifact@v2
with:
github_token: ${{secrets.SECRET_TOKEN}}
workflow: build-plugin.yaml

- name: Extract Version
id: plugin
uses: colathro/[email protected]
with:
file: "./rust/Cargo.toml"

- name: Prepare plugin directory
run: |
md plugin/solo-mode
move com.dim.streamdeck.exe/plugin.exe plugin/com.dim.streamdeck.exe
move service-installer/install-sd-solo-enabler.exe plugin/solo-mode/install-sd-solo-enabler.exe
move service-remover/remove-sd-solo-enabler.exe plugin/solo-mode/remove-sd-solo-enabler.exe
move service/sd-solo-enabler.exe plugin/solo-mode/sd-solo-enabler.exe
move com.dim.streamdeck/plugin plugin/com.dim.streamdeck
ren plugin com.dim.streamdeck.sdPlugin
- name: Package plugin
run: ./DistributionTool.exe -b -i com.dim.streamdeck.sdPlugin -o .
mkdir -p plugin/com.dim.streamdeck.sdPlugin/solo-mode
mv service-installer/install-sd-solo-enabler.exe plugin/com.dim.streamdeck.sdPlugin/solo-mode/
mv service-remover/remove-sd-solo-enabler.exe plugin/com.dim.streamdeck.sdPlugin/solo-mode/
mv service/sd-solo-enabler.exe plugin/com.dim.streamdeck.sdPlugin/solo-mode/
- name: Build plugin
working-directory: ./plugin
run: pnpm build

- name: Publish package
uses: marvinpinto/action-automatic-releases@latest
Expand Down
1 change: 1 addition & 0 deletions plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
},
"devDependencies": {
"@elgato/cli": "^0.2.0",
"@fcannizzaro/rollup-stream-deck-package": "^1.0.1",
"@rollup/plugin-commonjs": "^25.0.5",
"@rollup/plugin-node-resolve": "^15.2.2",
"@rollup/plugin-replace": "^5.0.5",
Expand Down
14 changes: 12 additions & 2 deletions plugin/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import url from "node:url";
import copy from "rollup-plugin-copy";
import { swc } from "rollup-plugin-swc3";
import replace from "@rollup/plugin-replace";
import distributionTool from "@fcannizzaro/rollup-stream-deck-package";

const isWatching = !!process.env.ROLLUP_WATCH;
const sdPlugin = "com.dim.streamdeck.sdPlugin";
Expand All @@ -29,23 +30,32 @@ const config = {
warn(warning);
},
plugins: [
isWatching &&
...(!isWatching && [
distributionTool({
plugin: sdPlugin,
}),
replace({
"process.env.CHECKPOINT_API": JSON.stringify(
process.env.CHECKPOINT_API
),
preventAssignment: true,
}),
]),
copy({
copyOnce: true,
hook: "buildStart",
targets: [
{
src: "./node_modules/clipboardy/fallbacks/windows",
dest: `${sdPlugin}/fallbacks/`,
},
{
src: "./node_modules/canvaskit-wasm/bin/canvaskit.wasm",
dest: sdPlugin,
},
],
}),
{
isWatching && {
name: "watch-externals",
buildStart: function () {
this.addWatchFile(`${sdPlugin}/manifest.json`);
Expand Down
7 changes: 7 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 968dde5

Please sign in to comment.