参照相关文档,在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 到此完成! 🙂
Hi there! This post couldn’t be written much better!
Reading through this post reminds me of my previous roommate!
He always kept talking about this. I’ll forward this
article to him. Fairly certain he will have a good read. Many
thanks for sharing!
What a material of un-ambiguity and preserveness of precious experience about unpredicted feelings.
This info is priceless. Where can I find out more?
wonderful issues altogether, you just received a emblem new reader.
What may you recommend about your publish that you made some days ago?
Any certain?
Great article! This is the kind of information that are supposed to be shared around the net.
Disgrace on the seek engines for not positioning this put up
upper! Come on over and seek advice from my site .
Thank you =)
Good day very cool blog!! Guy .. Excellent ..
Superb .. I’ll bookmark your blog and take the feeds additionally?
I am satisfied to find so many useful info right here in the publish, we need develop more strategies on this regard,
thanks for sharing. . . . . .
Oh my goodness! Awesome article dude! Thanks, However I am experiencing problems with your RSS.
I don’t know the reason why I can’t join it.
Is there anyone else having identical RSS issues?
Anyone who knows the solution can you kindly respond?
Thanx!!
We stumbled over here by a different web address and thought I might
as well check things out. I like what I see so
now i am following you. Look forward to finding out about your web page repeatedly.
Hi there to all, how is the whole thing, I think every one
is getting more from this website, and your views are pleasant in support
of new viewers.
Good information. Lucky me I came across your
site by accident (stumbleupon). I’ve saved it for later!
My family members always say that I am killing my time here at net,
except I know I am getting know-how everyday by reading such nice
content.
I loved as much as you will receive carried out right here.
The sketch is tasteful, your authored subject matter stylish.
nonetheless, you command get bought an shakiness
over that you wish be delivering the following. unwell unquestionably come more
formerly again as exactly the same nearly a lot often inside case you shield this
increase.
Hello there, just became alert to your blog through Google, and found that it’s truly informative.
I’m going to watch out for brussels. I’ll appreciate if you continue
this in future. A lot of people will be benefited from your writing.
Cheers!
Hello every one, here every one is sharing such familiarity, therefore it’s good
to read this web site, and I used to pay a quick visit this
webpage everyday.
Hello i am kavin, its my first time to commenting anyplace, when i read
this post i thought i could also make comment due to this brilliant article.
Thank you for sharing your thoughts. I really appreciate your efforts
and I am waiting for your further write ups thanks once again.
Very energetic blog, I loved that bit. Will there be a part 2?
Hey! This is kind of off topic but I need some advice from an established blog.
Is it difficult to set up your own blog? I’m not very techincal but I can figure things out pretty quick.
I’m thinking about making my own but I’m not sure where to
start. Do you have any tips or suggestions? Appreciate it
Hello there I am so grateful I found your site, I really found you by accident,
while I was looking on Askjeeve for something else, Anyways
I am here now and would just like to say thanks a lot for a fantastic post and a all
round interesting blog (I also love the theme/design),
I don’t have time to browse it all at the minute but I have saved
it and also added your RSS feeds, so when I have time I will be
back to read much more, Please do keep up the superb work.
This post is actually a pleasant one it assists
new net viewers, who are wishing in favor of blogging.
I absolutely love your website.. Great colors & theme.
Did you create this site yourself? Please reply back as I’m attempting
to create my own personal blog and would like to know where you got
this from or just what the theme is named.
Kudos!
I do not even know the way I finished up here, however
I believed this post used to be great. I don’t understand who you’re but certainly you are going to a famous blogger when you
are not already. Cheers!
I’m really inspired along with your writing talents and also with the structure
in your blog. Is that this a paid topic or did you
modify it your self? Either way keep up the excellent quality writing, it
is uncommon to see a nice blog like this one today..
Your style is unique in comparison to other folks I have read stuff
from. Thank you for posting when you’ve got the opportunity, Guess
I’ll just bookmark this site.
Hello, I do think your site could be having browser compatibility issues.
When I take a look at your blog in Safari, it looks fine however when opening in Internet Explorer, it’s got some overlapping issues.
I simply wanted to give you a quick heads up!
Other than that, fantastic blog!
When someone writes an article he/she retains the
idea of a user in his/her brain that how a user can be aware of it.
Therefore that’s why this post is outstdanding. Thanks!
Hello, i think that i saw you visited my weblog so
i came to “return the favor”.I’m trying to find things to enhance my website!I suppose its ok to use a few of your ideas!!
Hello, its nice paragraph concerning media print, we all be familiar with media is a
impressive source of information.
Valuable information. Fortunate me I discovered your web site accidentally,
and I’m stunned why this accident did not happened in advance!
I bookmarked it.
Right here is the perfect blog for anybody who wants to find out about this topic.
You understand a whole lot its almost tough to argue with you (not that I really will
need to…HaHa). You definitely put a brand new spin on a subject which has been written about for years.
Excellent stuff, just wonderful!
I am not sure where you’re getting your info, but great topic.
I needs to spend some time learning more or understanding more.
Thanks for magnificent information I was looking for
this info for my mission.
You really make it appear so easy together with your presentation however I find this topic to be really one thing that I feel I would by no
means understand. It kind of feels too complicated and extremely
large for me. I’m looking ahead in your subsequent post, I’ll attempt to get the
dangle of it!
I loved as much as you will receive carried out right
here. The sketch is attractive, your authored subject matter stylish.
nonetheless, you command get bought an nervousness over that
you wish be delivering the following. unwell unquestionably come more formerly
again since exactly the same nearly very often inside case
you shield this increase.
I was suggested this website by my cousin. I am not sure whether this post is
written by him as no one else know such detailed about my problem.
You’re amazing! Thanks!
Hi mates, pleasant paragraph and nice urging commented at
this place, I am actually enjoying by these.
I have read so many articles or reviews on the topic of the blogger lovers except this article is genuinely a good
article, keep it up.
Fascinating blog! Is your theme custom made or did you download it from somewhere?
A design like yours with a few simple tweeks would really make my blog stand out.
Please let me know where you got your theme. Thanks
I have been exploring for a little for any high-quality articles or weblog posts on this kind
of area . Exploring in Yahoo I ultimately stumbled upon this website.
Reading this info So i am satisfied to show that
I’ve a very good uncanny feeling I found out exactly what I needed.
I so much surely will make sure to do not disregard this site and provides
it a glance regularly.
Pretty great post. I just stumbled upon your blog and wished to mention that I’ve really
enjoyed surfing around your weblog posts. After all I will be subscribing for your feed and I am hoping you write again soon!
Hey there! I know this is kind of off topic but I was wondering if you knew where I could
get a captcha plugin for my comment form?
I’m using the same blog platform as yours and I’m having trouble finding one?
Thanks a lot!
Hello there, I found your website by the use
of Google whilst looking for a related matter, your website got here up, it seems good.
I have bookmarked it in my google bookmarks.
Hi there, simply turned into aware of your blog through Google, and located that it is really informative.
I am going to be careful for brussels. I’ll appreciate if you proceed this
in future. Lots of other people will be benefited out of your writing.
Cheers!
Hello are using WordPress for your site platform?
I’m new to the blog world but I’m trying to get started and set up my own. Do you require any html coding knowledge to make your own blog?
Any help would be greatly appreciated!
Hello! I know this is kinda off topic but I’d figured I’d ask.
Would you be interested in trading links or maybe guest writing a blog article
or vice-versa? My blog goes over a lot of the same subjects as yours and I think we could greatly benefit from each other.
If you are interested feel free to shoot me an e-mail.
I look forward to hearing from you! Fantastic blog by the way!
I am in fact glad to glance at this webpage posts which includes
tons of helpful facts, thanks for providing these data.
Hey I know this is off topic but I was wondering if you knew of any widgets I could add to
my blog that automatically tweet my newest twitter updates.
I’ve been looking for a plug-in like this for quite some
time and was hoping maybe you would have some experience with something like this.
Please let me know if you run into anything. I truly enjoy reading your blog and I look forward to your new updates.
No matter if some one searches for his essential thing, therefore
he/she needs to be available that in detail, so that thing is maintained over here.
You can certainly see your expertise within the work you write.
The world hopes for more passionate writers like you
who are not afraid to mention how they believe.
All the time go after your heart.
Valuable info. Fortunate me I found your site accidentally, and
I’m surprised why this accident didn’t happened earlier!
I bookmarked it.
Tremendous issues here. I’m very happy to look your article.
Thanks so much and I am having a look ahead to touch you.
Will you kindly drop me a e-mail?
Neat blog! Is your theme custom made or did you download it from somewhere?
A theme like yours with a few simple adjustements would really make my blog stand out.
Please let me know where you got your design. Thanks a lot