参照相关文档,在package.json中配置electron-builder的基础打包设置:
"build": { "productName": "Fishing Funds", "appId": "com.electron.1zilc.fishing-funds", "copyright": "Copyright © 2021 1zilc", "files": [ "dist/", "node_modules/", "index.html", "main.prod.js", "main.prod.js.map", "package.json" ], "afterSign": ".erb/scripts/Notarize.js", "mac": { "target": [ "dmg" ], "type": "distribution", "hardenedRuntime": true, "entitlements": "assets/entitlements.mac.plist", "entitlementsInherit": "assets/entitlements.mac.plist", "gatekeeperAssess": false }, "dmg": { "contents": [ { "x": 130, "y": 220 }, { "x": 410, "y": 220, "type": "link", "path": "/Applications" } ] }, "win": { "target": [ "nsis" ] }, "linux": { "target": [ "AppImage" ], "category": "Development" }, "directories": { "app": "src", "buildResources": "assets", "output": "release" }, "extraResources": [ "./assets/**" ] },
在该配置的基础上添加 publish key,如下:
"publish": { "provider": "github", "owner": "1zilc", "repo": "fishing-funds" }
以我自己的 Fishing Funds 为例
添加github token,网址如下: https://github.com/settings/tokens/new

勾选repo仓库相关权限
生成token后,临时添加环境变量中
export GH_TOKEN="<YOUR_TOKEN_HERE>"
在package.json中编写scripts,根据实际情况做调整
"scripts": { "build": "concurrently \"yarn build:main\" \"yarn build:renderer\"", "build:main": "cross-env NODE_ENV=production webpack --config ./.erb/configs/webpack.config.main.prod.babel.js", "build:renderer": "cross-env NODE_ENV=production webpack --config ./.erb/configs/webpack.config.renderer.prod.babel.js", "package": "rm -rf src/dist && yarn build && electron-builder build --publish never", "package-mac": "rm -rf src/dist && yarn build && electron-builder build --mac -p always", "package-linux": "rm -rf src/dist && yarn build && electron-builder build --linux", "package-win": "rm -rf src/dist && yarn build && electron-builder build --win --x64", "package-all": "rm -rf src/dist && yarn build && electron-builder build -mwl", "release-all": "rm -rf src/dist && yarn build && electron-builder build -mwl --publish always" },
# 添加发布参数即release-all中所写 electron-builder build --publish always
执行
yarn release-all

构建完成后会自动通过刚才设置的token去调github的发布接口,此时仓库中会自动生成一个草稿状态的release,在填写相关日志后即可进行版本发布
electron-builder 自动发布 github release 到此完成! 🙂
Thank you for sharing your thoughts. I really appreciate your efforts
and I am waiting for your next write ups thank you once again.
Hi there! I understand this is sort of off-topic but I had
to ask. Does managing a well-established website such as yours
require a massive amount work? I’m completely new to running
a blog but I do write in my diary daily. I’d like to start a blog so I can easily share my experience and thoughts online.
Please let me know if you have any ideas or tips for new aspiring bloggers.
Appreciate it!
I’m not sure exactly why but this site is loading extremely slow for me.
Is anyone else having this problem or is it a problem on my end?
I’ll check back later and see if the problem still exists.
When I originally commented I clicked the “Notify me when new comments are added” checkbox and now each time a
comment is added I get several e-mails with the same comment.
Is there any way you can remove people from that service?
Thank you!
Thanks for finally talking about > 通过electron-builder构建electron应用发布git release –
本人的窝 < Liked it!
Hi there! This post could not be written any better! Reading this post reminds me of my previous room mate!
He always kept chatting about this. I will forward this post to him.
Fairly certain he will have a good read. Thanks for sharing!
Generally I don’t learn post on blogs, but I wish to say that this
write-up very compelled me to try and do so! Your writing style has been surprised me.
Thank you, quite great post.
I am actually pleased to glance at this website posts
which consists of lots of useful information, thanks for providing these information.
This page certainly has all of the info I wanted concerning this subject and didn’t know who to ask.
That is really attention-grabbing, You are an overly professional blogger.
I have joined your rss feed and sit up for looking for extra of your magnificent
post. Additionally, I’ve shared your site
in my social networks
Howdy! I simply wish to offer you a huge thumbs up for the great info you’ve
got right here on this post. I’ll be coming back to your site for more soon.
Hey there! I simply wish to offer you a huge thumbs up for the great
information you have got right here on this post. I will be coming
back to your website for more soon.
Thank you for the auspicious writeup. It in fact
was a amusement account it. Look advanced to more added agreeable from you!
However, how can we communicate?
Hi there mates, how is the whole thing, and what
you desire to say about this paragraph, in my view its in fact amazing
for me.
I just like the helpful information you supply
to your articles. I’ll bookmark your blog and take a look
at again right here frequently. I am reasonably certain I’ll be told lots of new stuff right here!
Good luck for the next!
This design is steller! You obviously know how to keep a reader entertained.
Between your wit and your videos, I was almost moved to start my own blog (well, almost…HaHa!) Great job.
I really enjoyed what you had to say, and more than that, how you presented it.
Too cool!
This is a topic that’s near to my heart… Thank you! Where are your contact details though?
Hiya! Quick question that’s totally off topic. Do you know
how to make your site mobile friendly? My web site looks weird when browsing from my iphone4.
I’m trying to find a theme or plugin that might be able to resolve this issue.
If you have any recommendations, please share. Thanks!
Heya i’m for the first time here. I came across this board and I in finding It really helpful &
it helped me out a lot. I am hoping to present something again and aid others like you helped me.
Appreciating the dedication you put into your website and in depth information you provide.
It’s good to come across a blog every once in a while that isn’t
the same old rehashed material. Excellent read! I’ve saved your site and I’m adding your RSS
feeds to my Google account.
Hey There. I discovered your weblog using msn. This is a really
well written article. I’ll be sure to bookmark it and return to read extra of your helpful information. Thanks for the post.
I’ll definitely return.
I think this is one of the most vital info for me.
And i am satisfied studying your article. However want to observation on some general things, The website taste is wonderful,
the articles is truly great : D. Just right job, cheers
I visit daily a few web sites and blogs to read posts, but this
webpage provides feature based posts.
What’s up it’s me, I am also visiting this website on a regular basis, this site is really fastidious and
the people are in fact sharing nice thoughts.
I visited many web pages but the audio quality for audio songs present at this web
page is actually fabulous.
Excellent post. I’m facing some of these issues as well..
Hi! I’ve been reading your weblog for a long time now
and finally got the bravery to go ahead and give you a shout out from Humble Tx!
Just wanted to tell you keep up the great work!
For the reason that the admin of this website is
working, no hesitation very rapidly it will be famous, due to its feature contents.
Incredible! This blog looks just like my old one! It’s on a entirely different topic
but it has pretty much the same page layout and design. Outstanding choice of colors!
Hello, I read your blogs regularly. Your story-telling style is witty, keep it up!
It’s appropriate time to make a few plans for the long run and it is time to be happy.
I’ve learn this submit and if I may I wish to suggest you some interesting things or suggestions.
Perhaps you can write next articles referring
to this article. I want to learn more issues about it!
Ahaa, its fastidious conversation on the topic of this piece of writing at this place at this
weblog, I have read all that, so now me also commenting here.
I like what you guys are up too. Such clever work and
coverage! Keep up the great works guys I’ve added
you guys to my personal blogroll.
I am sure this paragraph has touched all the internet people,
its really really fastidious piece of writing on building up new
webpage.
It’s very easy to find out any topic on net as compared to textbooks, as I found this piece of writing at this
site.
It’s the best time to make some plans for the future and it’s time
to be happy. I’ve read this post and if I could I wish to suggest you some interesting things
or advice. Maybe you can write next articles referring to this article.
I desire to read even more things about it!
Hi there to all, the contents present at this web page are truly remarkable for people experience,
well, keep up the good work fellows.
I was able to find good advice from your content.
Thanks alot : ) for your post. I’d really like to write my opinion that the price of car insurance will vary from one scheme to another, given that there are so many different facets which give rise to the overall cost. One example is, the make and model of the automobile will have a tremendous bearing on the charge. A reliable older family vehicle will have a more economical premium than just a flashy fancy car.
You can definitely see your enthusiasm within the article you write.
The sector hopes for more passionate writers like you
who are not afraid to mention how they believe.
All the time follow your heart.
Whoa! This blog looks exactly like my old one!
It’s on a completely different subject but it has pretty much the same layout and design. Great choice of colors!
Hello! I could have sworn I’ve been to this web site before but after browsing through a few of
the posts I realized it’s new to me. Regardless, I’m definitely pleased
I stumbled upon it and I’ll be bookmarking it and checking back often!
Please let me know if you’re looking for a writer for your blog.
You have some really good posts and I feel I would be a good asset.
If you ever want to take some of the load off, I’d really like to write some material for your blog in exchange for a link back to mine.
Please shoot me an email if interested. Cheers!
Hello There. I discovered your blog using msn. That is
a really well written article. I will make sure to bookmark it and come
back to learn extra of your useful information. Thanks for the
post. I’ll definitely comeback.
You are so interesting! I don’t think I’ve truly read anything like this before.
So wonderful to discover another person with original thoughts on this
subject matter. Seriously.. many thanks for starting this up.
This website is one thing that is required on the web, someone with a little originality!
That is very interesting, You are an overly professional
blogger. I’ve joined your rss feed and sit up for in quest of extra of
your excellent post. Also, I’ve shared your site in my social networks
First of all I would like to say superb blog! I had a quick question that I’d like to ask if you don’t mind.
I was curious to know how you center yourself and clear your mind
before writing. I have had difficulty clearing my thoughts in getting my thoughts out.
I do take pleasure in writing however it just seems like the first 10 to 15
minutes are lost simply just trying to figure out how to begin. Any suggestions or tips?
Thank you!
Greetings I am so happy I found your blog page, I really found
you by accident, while I was searching on Bing for something else,
Anyhow I am here now and would just like to say many thanks for a tremendous post
and a all round thrilling blog (I also love the theme/design), I don’t have
time to browse it all at the minute but I have book-marked it and also added in your
RSS feeds, so when I have time I will be back to
read much more, Please do keep up the excellent work.
Great goods from you, man. I’ve understand your stuff previous to and you’re just too
magnificent. I actually like what you have acquired
here, certainly like what you’re stating and the way in which you say it.
You make it entertaining and you still take care of to keep it smart.
I can’t wait to read far more from you. This is actually a great web site.
I am sure this paragraph has touched all the internet people,
its really really fastidious paragraph on building up new
blog.