summaryrefslogtreecommitdiff
path: root/.github/workflows/release.yml
blob: 40948b529797defe99435b00cbd3810b31fcae26 (plain)
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
name: Release Plugin

on:
  push:
    tags:
      - 'v*'

jobs:
  release:
    runs-on: ubuntu-latest
    
    steps:
    - name: Checkout code
      uses: actions/checkout@v4
      
    - name: Setup Node.js
      uses: actions/setup-node@v4
      with:
        node-version: '18'
        
    - name: Setup pnpm
      uses: pnpm/action-setup@v4
      with:
        version: latest
        
    - name: Create CLI directory
      run: mkdir -p cli
      
    - name: Download Decky CLI
      run: |
        curl -L -o cli/decky "https://github.com/SteamDeckHomebrew/cli/releases/latest/download/decky-linux-x86_64"
        chmod +x cli/decky
        
    - name: Clean node_modules (if exists)
      run: rm -rf node_modules
      
    - name: Install dependencies
      run: pnpm install
      
    - name: Build backend (if needed)
      run: |
        if [ -f "backend/Makefile" ]; then
          cd backend && make
        fi
        
    - name: Build plugin
      run: ./cli/decky plugin build .
      
    - name: Get plugin name for artifact
      id: plugin_name
      run: |
        PLUGIN_NAME=$(jq -r '.name' plugin.json)
        echo "name=$PLUGIN_NAME" >> $GITHUB_OUTPUT
        echo "Plugin name: $PLUGIN_NAME"
        
    - name: Create Release
      uses: softprops/action-gh-release@v2
      with:
        files: out/*.zip
        generate_release_notes: true
        draft: false
        prerelease: false
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}