参照相关文档,在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 到此完成! 🙂
My brother recommended I might like this website.
He was totally right. This post truly made my day.
You can not imagine simply how much time I had spent for this info!
Thanks!
The other day, while I was at work, my sister stole my iPad and tested to see if it can survive a 30
foot drop, just so she can be a youtube sensation. My iPad is now broken and she has 83 views.
I know this is completely off topic but I had to share it with someone!
Great post however , I was wondering if you could write a litte more on this topic?
I’d be very thankful if you could elaborate a little bit more.
Kudos!
I am sure this article has touched all the internet users,
its really really good article on building
up new web site.
I was able to find good advice from your blog articles.
The next time I read a blog, I hope that it does not disappoint
me as much as this particular one. I mean, Yes, it was my choice to read through, nonetheless I
genuinely believed you would have something useful to
say. All I hear is a bunch of moaning about something that you can fix
if you weren’t too busy looking for attention.
Wow, this piece of writing is nice, my sister is analyzing
these things, thus I am going to let know her.
Very nice article, totally what I was looking for.
It’s the best time to make some plans for the future and it’s time to be happy.
I have read this post and if I could I want to suggest you few interesting
things or suggestions. Perhaps you can write next articles referring to this article.
I want to read even more things about it!
Hi there would you mind letting me know which web host you’re
utilizing? I’ve loaded your blog in 3 different web browsers and I must say this blog loads a lot quicker then most.
Can you suggest a good internet hosting provider at a honest price?
Thanks a lot, I appreciate it!
We stumbled over here by a different website and thought I might as well check things
out. I like what I see so now i am following you. Look forward
to checking out your web page repeatedly.
I truly love your site.. Very nice colors & theme. Did you build this web site yourself?
Please reply back as I’m looking to create my own personal website and would
love to find out where you got this from or exactly
what the theme is named. Thank you!
Greetings! Very useful advice in this particular article!
It’s the little changes that produce the biggest changes.
Many thanks for sharing!
I love it when people get together and share thoughts.
Great blog, stick with it!
What’s Taking place i am new to this, I stumbled upon this I have
found It positively helpful and it has helped me out
loads. I hope to give a contribution & help different users like
its helped me. Great job.
What’s up to all, the contents existing at this site are truly awesome for people experience, well, keep up the nice
work fellows.
Pretty nice post. I just stumbled upon your blog and wished to
say that I’ve truly enjoyed browsing your weblog posts.
After all I will be subscribing in your feed and I hope you write again soon!
This is the perfect site for anybody who would like to understand 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 new spin on a topic that has been discussed for decades.
Great stuff, just great!
I wanted to thank you for this wonderful read!! I definitely loved
every little bit of it. I have got you bookmarked to look at new stuff you
Hi everybody, here every one is sharing these kinds of knowledge, therefore it’s good to read this website, and
I used to visit this weblog daily.
You made some really good points there. I looked on the net
to find out more about the issue and found most people will go
along with your views on this web site.
Hello! I know this is kind of off topic but I was wondering if you knew where I could locate a captcha plugin for my comment
form? I’m using the same blog platform as yours and I’m
having problems finding one? Thanks a lot!
Whats up this is kind of of off topic but I was wanting to know
if blogs use WYSIWYG editors or if you have to manually code with
HTML. I’m starting a blog soon but have no coding know-how so I wanted to get advice from someone with experience.
Any help would be enormously appreciated!
I am sure this post has touched all the internet viewers, its really really good paragraph on building up new weblog.
hey there and thank you for your information – I’ve certainly picked up anything new from right
here. I did however expertise some technical issues using this web
site, as I experienced to reload the site many times previous
to I could get it to load correctly. I had been wondering if your hosting is OK?
Not that I am complaining, but slow loading instances times will
often affect your placement in google and could damage your quality
score if advertising and marketing with Adwords. Anyway I’m adding this RSS
to my e-mail and could look out for a lot more of your respective fascinating content.
Ensure that you update this again very soon.
Wonderful beat ! I wish to apprentice while you amend your site, how could i subscribe
for a blog web site? The account aided me a acceptable deal.
I had been tiny bit acquainted of this your broadcast
offered bright clear idea
I’m not that much of a online reader to be honest
but your sites really nice, keep it up! I’ll go ahead and bookmark your site to come back later.
All the best
I am sure this post has touched all the internet users, its really really good paragraph on building up
new weblog.
Unquestionably believe that that you said. Your favorite justification appeared
to be at the web the simplest thing to take into accout of.
I say to you, I certainly get annoyed while folks think about worries that they just don’t recognize
about. You managed to hit the nail upon the top as neatly as outlined
out the whole thing with no need side effect , other folks can take a signal.
Will likely be back to get more. Thanks
It’s amazing designed for me to have a website, which is good designed for
my know-how. thanks admin
I could not refrain from commenting. Perfectly written!
Hello, I think your blog might be having browser compatibility issues.
When I look at your website in Firefox, it looks fine but when opening
in Internet Explorer, it has some overlapping. I just wanted to give you a quick heads up!
Other then that, terrific blog!
Pretty great post. I just stumbled upon your
blog and wanted to mention that I’ve really enjoyed browsing your blog posts.
In any case I’ll be subscribing in your feed and I am hoping you
write once more very soon!
It’s perfect 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 desire to suggest you some interesting
things or advice. Maybe you can write next articles referring to this
article. I want to read more things about it!
It is appropriate time to make some plans for the future and it is time to be happy.
I have read this post and if I could I want to suggest you few interesting things or suggestions.
Perhaps you could write next articles referring to this article.
I want to read even more things about it!
I think this is among the most important information for me.
And i am glad reading your article. But wanna remark
on few general things, The website style is perfect, the articles is really nice : D.
Good job, cheers
Thanks for one’s marvelous posting! I truly enjoyed reading it, you can be a great author.
I will remember to bookmark your blog and may come back in the foreseeable future.
I want to encourage you to ultimately continue your great work,
have a nice morning!
This is my first time pay a visit at here and i am in fact impressed to read everthing at
alone place.
Hi, i feel that i noticed you visited my blog so i got here to go back the want?.I am
attempting to find things to enhance my website!I suppose its adequate to make use
of a few of your concepts!!
Wow, this piece of writing is pleasant, my younger sister is analyzing such
things, so I am going to inform her.
I must thank you for the efforts you’ve put in penning this website.
I really hope to see the same high-grade content by
you in the future as well. In truth, your creative
writing abilities has motivated me to get my very own website now 😉
I am sure this paragraph has touched all the internet users, its really really pleasant piece of writing on building up new webpage.
Thanks for the useful information on credit repair on this site. Things i would offer as advice to people is always to give up a mentality that they’ll buy now and shell out later. Like a society we all tend to try this for many issues. This includes holidays, furniture, plus items we wish. However, you have to separate a person’s wants from the needs. When you’re working to fix your credit score actually you need some trade-offs. For example you possibly can shop online to economize or you can click on second hand shops instead of high priced department stores for clothing.
I will right away seize your rss as I can not find your email subscription link or newsletter service.
Do you have any? Kindly permit me recognize in order that I could subscribe.
Thanks.
I have been surfing online more than 3 hours today, yet I never found any
interesting article like yours. It is pretty worth enough
for me. Personally, if all site owners and bloggers made good content as you did, the internet will be
a lot more useful than ever before.
Hey would you mind sharing which blog platform you’re working with?
I’m planning to start my own blog soon but I’m having a hard time choosing between BlogEngine/Wordpress/B2evolution and
Drupal. The reason I ask is because your design seems different then most
blogs and I’m looking for something unique. P.S
Apologies for getting off-topic but I had to ask!
It’s appropriate time to make a few plans for the long run and it
is time to be happy. I’ve read this publish and if I may just I
desire to counsel you few interesting things or advice.
Perhaps you can write next articles relating to this article.
I wish to learn even more issues approximately it!
Hey just wanted to give you a brief heads up and let you know a
few of the pictures aren’t loading properly. I’m not sure why but I think its a
linking issue. I’ve tried it in two different internet browsers and both show the same results.
Wow! In the end I got a webpage from where I can genuinely take useful information regarding my study and knowledge.
I seriously love your website.. Very nice colors & theme.
Did you build this website yourself? Please reply back as I’m looking to
create my very own site and would like to learn where you got this from or what the theme is named.
Kudos!