Skip to content

Commit af7e8e4

Browse files
Merge pull request #13 from xXJSONDeruloXx/gh-workflow
initial build workflow
2 parents 7cb6d95 + 40e1007 commit af7e8e4

2 files changed

Lines changed: 126 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Build Plugin
2+
3+
on:
4+
push:
5+
branches: [ main, gh-workflow ]
6+
pull_request:
7+
branches: [ main, gh-workflow ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: '18'
22+
23+
- name: Setup pnpm
24+
uses: pnpm/action-setup@v4
25+
with:
26+
version: latest
27+
28+
- name: Create CLI directory
29+
run: mkdir -p cli
30+
31+
- name: Download Decky CLI
32+
run: |
33+
curl -L -o cli/decky "https://github.com/SteamDeckHomebrew/cli/releases/latest/download/decky-linux-x86_64"
34+
chmod +x cli/decky
35+
36+
- name: Verify Decky CLI
37+
run: ./cli/decky --version
38+
39+
- name: Clean node_modules (if exists)
40+
run: rm -rf node_modules
41+
42+
- name: Install dependencies
43+
run: pnpm install
44+
45+
- name: Build backend (if needed)
46+
run: |
47+
if [ -f "backend/Makefile" ]; then
48+
cd backend && make
49+
fi
50+
51+
- name: Build plugin
52+
run: ./cli/decky plugin build .
53+
54+
- name: Upload build artifact
55+
uses: actions/upload-artifact@v4
56+
with:
57+
name: lossless-scaling
58+
path: out/*.zip
59+
retention-days: 30
60+
61+
- name: List output files
62+
run: ls -la out/

.github/workflows/release.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Release Plugin
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: '18'
20+
21+
- name: Setup pnpm
22+
uses: pnpm/action-setup@v4
23+
with:
24+
version: latest
25+
26+
- name: Create CLI directory
27+
run: mkdir -p cli
28+
29+
- name: Download Decky CLI
30+
run: |
31+
curl -L -o cli/decky "https://github.com/SteamDeckHomebrew/cli/releases/latest/download/decky-linux-x86_64"
32+
chmod +x cli/decky
33+
34+
- name: Clean node_modules (if exists)
35+
run: rm -rf node_modules
36+
37+
- name: Install dependencies
38+
run: pnpm install
39+
40+
- name: Build backend (if needed)
41+
run: |
42+
if [ -f "backend/Makefile" ]; then
43+
cd backend && make
44+
fi
45+
46+
- name: Build plugin
47+
run: ./cli/decky plugin build .
48+
49+
- name: Get plugin name for artifact
50+
id: plugin_name
51+
run: |
52+
PLUGIN_NAME=$(jq -r '.name' plugin.json)
53+
echo "name=$PLUGIN_NAME" >> $GITHUB_OUTPUT
54+
echo "Plugin name: $PLUGIN_NAME"
55+
56+
- name: Create Release
57+
uses: softprops/action-gh-release@v2
58+
with:
59+
files: out/*.zip
60+
generate_release_notes: true
61+
draft: false
62+
prerelease: false
63+
env:
64+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)