Skip to content

Commit

Permalink
add ubuntu app and release
Browse files Browse the repository at this point in the history
  • Loading branch information
fs committed Jan 22, 2024
1 parent 90c2bfa commit f318c30
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 2 deletions.
File renamed without changes.
38 changes: 38 additions & 0 deletions .github/workflows/electron_build_ubuntu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build and Release

on:
push:
tags:
- '*'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v2

- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: 14

- name: Install Dependencies
run: |
cd music_player
npm install
- name: Build for Linux
run: |
cd music_player
npm run dist
- name: Upload Release Assets for Linux
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
music_player/dist/*.deb
music_player/dist/*.AppImage
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
2 changes: 1 addition & 1 deletion music_player/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ function saveTracks(newTrack) {
tracks.push(newTrack);
}
}

console.log("add tracks to file ", newTrack)
// 将更新后的数据写回tracks.json
fs.writeFileSync(tracksFilePath, JSON.stringify(tracks, null, 2));
}
Expand Down
17 changes: 16 additions & 1 deletion music_player/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"name": "music_player",
"version": "1.0.0",
"description": "",
"description": "A simple music player application",
"homepage": "https://github.com/fridayfang/electron_tutorial",
"main": "index.js",
"scripts": {
"start": "electron .",
Expand All @@ -13,6 +14,17 @@
"mac": {
"category": "public.app-category.music"
},
"linux": {
"category": "Chat;GNOME;GTK;Network;InstantMessaging",
"packageCategory": "GNOME;GTK;Network;InstantMessaging",
"description": "simpleMusicPlayer Desktop Client for Linux",
"target": [
"deb",
"AppImage"
],
"maintainer": "[email protected]",
"artifactName": "${productName}-${version}.${ext}"
},
"dmg": {
"contents": [
{
Expand All @@ -31,6 +43,9 @@
"width": 500,
"height": 500
}
},
"deb": {
"synopsis": "Music Player Desktop App"
}
},
"author": "",
Expand Down

0 comments on commit f318c30

Please sign in to comment.