-
Notifications
You must be signed in to change notification settings - Fork 1
172 lines (148 loc) · 5.61 KB
/
release.yml
File metadata and controls
172 lines (148 loc) · 5.61 KB
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
name: Release
# Trigger the workflow when a new tag is created
# The tag should follow semantic versioning (e.g., v1.3.0, 1.4.0)
on:
push:
tags:
- 'v*'
- '*.*.*'
jobs:
build:
runs-on: ${{ matrix.os }}
# Permissions needed in case electron-builder tries to publish
permissions:
contents: read
# Build for multiple platforms in parallel
strategy:
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
include:
- os: windows-latest
platform: win
- os: macos-latest
platform: mac
- os: ubuntu-latest
platform: linux
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build application
run: npm run build
env:
# Disable automatic publishing by electron-builder
# We handle releases through the release job instead
PUBLISH: never
- name: Extract version from package.json
id: get_version
run: |
VERSION=$(node -p "require('./package.json').version")
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Extracted version: $VERSION"
shell: bash
- name: Prepare release artifacts
shell: bash
run: |
# Create a directory for artifacts
mkdir -p release-artifacts
# Copy built files based on platform
if [ "${{ matrix.platform }}" == "win" ]; then
# Windows: Copy NSIS installer and related files
cp "dist/Frame Chopper Setup ${{ steps.get_version.outputs.version }}.exe" release-artifacts/ || true
cp "dist/latest.yml" release-artifacts/ || true
# Also copy the blockmap if it exists
cp "dist/"*.blockmap release-artifacts/ || true
elif [ "${{ matrix.platform }}" == "mac" ]; then
# macOS: Copy DMG file
cp "dist/"*.dmg release-artifacts/ || true
cp "dist/latest.yml" release-artifacts/ || true
elif [ "${{ matrix.platform }}" == "linux" ]; then
# Linux: Copy AppImage file
cp "dist/"*.AppImage release-artifacts/ || true
cp "dist/latest.yml" release-artifacts/ || true
fi
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.platform }}-build-${{ steps.get_version.outputs.version }}
path: release-artifacts/*
retention-days: 30
release:
needs: build
runs-on: ubuntu-latest
if: github.ref_type == 'tag'
# Permissions needed to create releases
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Extract version from package.json
id: get_version
run: |
VERSION=$(node -p "require('./package.json').version")
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Extracted version: $VERSION"
- name: Download Windows build artifacts
uses: actions/download-artifact@v4
with:
name: win-build-${{ steps.get_version.outputs.version }}
path: ./release-artifacts/win
- name: Download macOS build artifacts
uses: actions/download-artifact@v4
with:
name: mac-build-${{ steps.get_version.outputs.version }}
path: ./release-artifacts/mac
continue-on-error: true
- name: Download Linux build artifacts
uses: actions/download-artifact@v4
with:
name: linux-build-${{ steps.get_version.outputs.version }}
path: ./release-artifacts/linux
continue-on-error: true
- name: List downloaded artifacts
shell: bash
run: |
echo "Windows artifacts:"
ls -la ./release-artifacts/win/ || echo "No Windows artifacts found"
echo ""
echo "macOS artifacts:"
ls -la ./release-artifacts/mac/ || echo "No macOS artifacts found"
echo ""
echo "Linux artifacts:"
ls -la ./release-artifacts/linux/ || echo "No Linux artifacts found"
- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.ref_name }}
name: Release ${{ steps.get_version.outputs.version }}
body: |
## Frame Chopper ${{ steps.get_version.outputs.version }}
### Changes
- See commit history for details
### Downloads
- Windows installer available in the assets below
- macOS installer available in the assets below (if built)
- Linux AppImage available in the assets below (if built)
### Installation
1. Download the installer for your platform
2. Run the installer and follow the on-screen instructions
3. Make sure FFmpeg is installed on your system before using the app
**Note**: FFmpeg must be installed separately. See the README for installation instructions.
files: |
release-artifacts/win/*
release-artifacts/mac/*
release-artifacts/linux/*
fail_on_unmatched_files: false
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}