Skip to content

Commit f318c30

Browse files
author
fs
committed
add ubuntu app and release
1 parent 90c2bfa commit f318c30

4 files changed

Lines changed: 55 additions & 2 deletions

File tree

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Build and Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Check out Git repository
13+
uses: actions/checkout@v2
14+
15+
- name: Install Node.js
16+
uses: actions/setup-node@v1
17+
with:
18+
node-version: 14
19+
20+
- name: Install Dependencies
21+
run: |
22+
cd music_player
23+
npm install
24+
25+
- name: Build for Linux
26+
run: |
27+
cd music_player
28+
npm run dist
29+
30+
- name: Upload Release Assets for Linux
31+
uses: softprops/action-gh-release@v1
32+
if: startsWith(github.ref, 'refs/tags/')
33+
with:
34+
files: |
35+
music_player/dist/*.deb
36+
music_player/dist/*.AppImage
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}

music_player/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ function saveTracks(newTrack) {
127127
tracks.push(newTrack);
128128
}
129129
}
130-
130+
console.log("add tracks to file ", newTrack)
131131
// 将更新后的数据写回tracks.json
132132
fs.writeFileSync(tracksFilePath, JSON.stringify(tracks, null, 2));
133133
}

music_player/package.json

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"name": "music_player",
33
"version": "1.0.0",
4-
"description": "",
4+
"description": "A simple music player application",
5+
"homepage": "https://github.com/fridayfang/electron_tutorial",
56
"main": "index.js",
67
"scripts": {
78
"start": "electron .",
@@ -13,6 +14,17 @@
1314
"mac": {
1415
"category": "public.app-category.music"
1516
},
17+
"linux": {
18+
"category": "Chat;GNOME;GTK;Network;InstantMessaging",
19+
"packageCategory": "GNOME;GTK;Network;InstantMessaging",
20+
"description": "simpleMusicPlayer Desktop Client for Linux",
21+
"target": [
22+
"deb",
23+
"AppImage"
24+
],
25+
"maintainer": "asyn@example.com",
26+
"artifactName": "${productName}-${version}.${ext}"
27+
},
1628
"dmg": {
1729
"contents": [
1830
{
@@ -31,6 +43,9 @@
3143
"width": 500,
3244
"height": 500
3345
}
46+
},
47+
"deb": {
48+
"synopsis": "Music Player Desktop App"
3449
}
3550
},
3651
"author": "",

0 commit comments

Comments
 (0)