Quantcast Guide: Automagically package and publish addons - Page 3 - WoWInterface
Thread Tools Display Modes
08-11-18, 01:34 PM   #41
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,676
Originally Posted by StormFX View Post
Right, but without third-party scripts, it doesn't actually validate anything.
That is correct. If you want an example with tests/evaluations, see how Rainrider did it in his addon "oUF_Dispellable":
https://github.com/Rainrider/oUF_Dis...er/.travis.yml

(Sorry for the late response, I seem to have missed your reply.)
  Reply With Quote
08-12-18, 02:27 PM   #42
Xruptor
A Flamescale Wyrmkin
 
Xruptor's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 106
Originally Posted by p3lim View Post
The only option you should need to enable now is the "Build pushed branches" in each repo's settings.
Everything else is detected from the .travis.yml file.

Edit: I've updated the guide to reflect the changes from travis-ci.org to travis-ci.com.
(Although personally I've moved over to CircleCI instead, see packager#18 if you're interested)
Thanks for the update P3lim. Is there any major differences between TravisCI and CircleCI? Why the switch? I'll take a look at it since I see the packager update for it. Just curious
__________________
Click HERE for the ultimate idiot test.

if (sizeof(sadness) > sizeof(happiness)) { initDepression(); }
  Reply With Quote
08-12-18, 02:30 PM   #43
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,676
Originally Posted by Xruptor View Post
Thanks for the update P3lim. Is there any major differences between TravisCI and CircleCI? Why the switch? I'll take a look at it since I see the packager update for it. Just curious
There are some differences, but for the packaging needs it's indifferent. It's slightly faster because it runs Docker images which we can pre-pack (like I did with the packager PR) instead of installing dependencies every time (like we do with Travis, although that can be cached to improve speeds).

I switched over because after TravisCI merged org to com my GitHub organization (where all my addons are hosted) got screwed up, and TravisCI support couldn't help me with it and told me to just wait for the merge to go through by itself (which could take months), so it was more of a necessity for me.
We still use TravisCI for oUF, and there's no real need to change.

Last edited by p3lim : 08-12-18 at 02:32 PM.
  Reply With Quote
08-31-18, 11:30 AM   #44
Dajn
A Defias Bandit
AddOn Author - Click to view addons
Join Date: Jul 2018
Posts: 2
Regex string

Hey, thanks for the great tutorial!
The only thing I would love to get some help with is the regex string, as I cant get it to work. x)

The format I usually use for my versions is either a tag with 8.0.1.18 for a full release or 8.0.1.18-alpha/beta for beta/alpha releases.

Any help with this would be wonderful!

With regards,
Dajn
  Reply With Quote
08-31-18, 11:38 AM   #45
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,676
Originally Posted by Dajn View Post
Hey, thanks for the great tutorial!
The only thing I would love to get some help with is the regex string, as I cant get it to work. x)

The format I usually use for my versions is either a tag with 8.0.1.18 for a full release or 8.0.1.18-alpha/beta for beta/alpha releases.

Any help with this would be wonderful!

With regards,
Dajn
Code:
/^\d+\.\d+\.\d+\.\d+(-\w+)?$/
https://regexr.com/3upce look at the explaination at the bottom.

Last edited by p3lim : 08-31-18 at 11:42 AM.
  Reply With Quote
08-31-18, 12:39 PM   #46
Dajn
A Defias Bandit
AddOn Author - Click to view addons
Join Date: Jul 2018
Posts: 2
Originally Posted by p3lim View Post
Code:
/^\d+\.\d+\.\d+\.\d+(-\w+)?$/
https://regexr.com/3upce look at the explaination at the bottom.
Ty!

Been trying to get the hang of regex lately as I will start use it at work a lot, so this tutorial was a step in the right direction to start to learn it.

With regards,
Dajn
  Reply With Quote
10-01-18, 03:53 PM   #47
Xruptor
A Flamescale Wyrmkin
 
Xruptor's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 106
Hey p3lim I'm having an issue where the packager isn't uploading properly to wowinterface.com

My tags are in the following format. v5.4, v.5.5, v5.6 etc..

so I changed the regex to the following

Code:
/^v?\d+\.\d+(\.\d+)?(-\S*)?$/
That seems to do the trick and picks up the 'v' in front of my tags. I didn't initially incorporate a .pkgmeta file as I don't need to do any changes to my addon and just want it upload exactly the way it is. Travis CI did pickup the tag and did the whole sing and dance it does. It completed with a green all clear. However when I went to wowinterface the file wasn't uploaded and the version didn't change either.

So I then added a .pkgmeta file but left it empty. That didn't seem to work. So I'm thinking that something needs to go into this file. I don't need externals or anything. Just simply upload the addon as is to wowinterface.

BTW: Yes I did make the modifications to the .toc file and added the addon IDs for both curse and wowinterface.com

Code:
## X-Curse-Project-ID: 28603
## X-WoWI-ID: 18787
Hope you can help. I may be missing something. Thanks for your help advance p3lim! You rock
__________________
Click HERE for the ultimate idiot test.

if (sizeof(sadness) > sizeof(happiness)) { initDepression(); }

Last edited by Xruptor : 10-01-18 at 03:57 PM.
  Reply With Quote
10-01-18, 04:09 PM   #48
Xruptor
A Flamescale Wyrmkin
 
Xruptor's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 106
Lol!!!!

Originally Posted by p3lim View Post
YAML Code:
  1. sudo: false
  2. language: c
  3.  
  4. addons:
  5.   apt:
  6.     packages:
  7.     - pandoc
  8.  
  9. script: curl -s [url]https://raw.githubusercontent.com/BigWigsMods/packager/master/release.sh[/url] | bash
  10.  
  11. branches:
  12.   only:
  13.   - /^\d+\.\d+(\.\d+)?(-\S*)?$/
LOLOLOL I figured it out @p3lim!! Your instructions has the curl with URL tags. It should be like this.

Code:
script: curl -s https://raw.githubusercontent.com/BigWigsMods/packager/master/release.sh | bash
It worked perfectly when I did this. It's all working fine now Turns out no you don't need the .pkgmeta file if you want to just upload it the way it is without modifications.
__________________
Click HERE for the ultimate idiot test.

if (sizeof(sadness) > sizeof(happiness)) { initDepression(); }

Last edited by Xruptor : 10-01-18 at 04:45 PM.
  Reply With Quote
10-01-18, 10:16 PM   #49
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,676
Originally Posted by Xruptor View Post
LOLOLOL I figured it out @p3lim!! Your instructions has the curl with URL tags. It should be like this.

It worked perfectly when I did this. It's all working fine now Turns out no you don't need the .pkgmeta file if you want to just upload it the way it is without modifications.
Thank you for spotting that, fixed it up.
Happy it all works for you .
  Reply With Quote
10-24-18, 01:02 PM   #50
Rythal
Featured Artist
Featured
Join Date: Aug 2012
Posts: 1,456
Trying to get this setup myself and not having much luck with the regex even tho it should work :/

Currently they get tagged as vA.B.C(.D) so can be v8.0.0 or v8.0.0.1

Trying - ^v\d+.\d+.\d+(.\d+)?$ which works in any self-tests I do, but on Travis i'm getting 'Branch "v8.0.1.4" not included per configuration.'

What have I done wrong?
  Reply With Quote
10-24-18, 01:17 PM   #51
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,676
Originally Posted by Rythal View Post
Trying to get this setup myself and not having much luck with the regex even tho it should work :/

Currently they get tagged as vA.B.C(.D) so can be v8.0.0 or v8.0.0.1

Trying - ^v\d+.\d+.\d+(.\d+)?$ which works in any self-tests I do, but on Travis i'm getting 'Branch "v8.0.1.4" not included per configuration.'

What have I done wrong?
That should work fine, although I'd escape the punctuations (many regex parsers are picky).
Could you show me your .travis.yml file?
Attached Thumbnails
Click image for larger version

Name:	a87d.png
Views:	2
Size:	7.0 KB
ID:	9149  

Last edited by p3lim : 10-24-18 at 01:21 PM.
  Reply With Quote
10-24-18, 01:50 PM   #52
Rythal
Featured Artist
Featured
Join Date: Aug 2012
Posts: 1,456
Originally Posted by p3lim View Post
That should work fine, although I'd escape the punctuations (many regex parsers are picky).
Could you show me your .travis.yml file?
Code:
sudo: false
language: c
 
addons:
  apt:
    packages:
    - pandoc
 
script: curl -s https://raw.githubusercontent.com/BigWigsMods/packager/master/release.sh | bash
 
branches:
  only:
  - ^v\d+\.\d+\.\d+(\.\d+)?$
Just tried it with the escaped punctuation but still got not included by config error.

Bah I think I see the problem already... forgot the /'s
  Reply With Quote
10-24-18, 02:04 PM   #53
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,676
Originally Posted by Rythal View Post
Bah I think I see the problem already... forgot the /'s
There you go

I mentioned an alternative to the Travis method here, which eliminates the need to verify tag structure (it just assumes any tag is a release-ready version).
(Plus, it's easier to set up and expand upon )

Last edited by p3lim : 10-24-18 at 02:58 PM.
  Reply With Quote
10-25-18, 06:36 AM   #54
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,729
Thanks p3lim for providing this. I need some help.

I added the .travis.yml and the .pkgmeta to one of my addons in my github repo. Currently the .pkgmeta and the .travis.yml use CRLF as ending. Is that a problem? I told GIT bash for windows not to mess with line endings.

https://github.com/zorker/rothui/tre...w8.0/rVignette

I then used the git command you provided using git bash for windows in the git directory of rVignette.

I'm not sure but I think my whole repo got that tag?! Is that correct?

https://github.com/zorker/rothui/tree/v800.20181025

Once I started the git bash command I had to log into github and the tag completed.

But nothing else seem to have happened? What am I missing?

I had added the wowi token to the Travis page before. My travis page is all grey and says: There is no build on the default branch yet?

Ok I checked the travis request page. I can see some error messages now. Travis does seem to try to generate a new build when I commit with Github desktop to master. (The first two requests) Why is that?

*edit* Ohhh I see. It would run on any commit but when reading the config file would only react to branches that match the pattern.

That being said. To correct the error from my understanding I have to put the .travis.yml in the repo root right? What does that mean for the packager? Will he parse all directories and upload all of them at once? If I only make a change to one of the addons all will be updated? How do I do this for specific directories?
Attached Thumbnails
Click image for larger version

Name:	travis.jpg
Views:	3
Size:	64.1 KB
ID:	9158  Click image for larger version

Name:	git-bash.png
Views:	4
Size:	14.4 KB
ID:	9159  Click image for larger version

Name:	travis2.jpg
Views:	4
Size:	44.5 KB
ID:	9160  
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW) | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 10-25-18 at 07:04 AM.
  Reply With Quote
10-25-18, 07:11 AM   #55
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,676
Originally Posted by zork View Post
Thanks p3lim for providing this. I need some help.

I added the .travis.yml and the .pkgmeta to one of my addons in my github repo. Currently the .pkgmeta and the .travis.yml use CRLF as ending. Is that a problem? I told GIT bash for windows not to mess with line endings.

https://github.com/zorker/rothui/tre...w8.0/rVignette

I then used the git command you provided using git bash for windows in the git directory of rVignette.

I'm not sure but I think my whole repo got that tag?! Is that correct?

https://github.com/zorker/rothui/tree/v800.20181025

Once I started the git bash command I had to log into github and the tag completed.

But nothing else seem to have happened? What am I missing?

I had added the wowi token to the Travis page before. My travis page is all grey and says: There is no build on the default branch yet?

Ok I checked the travis request page. I can see some error messages now. Travis does seem to try to generate a new build when I commit with Github desktop to master. (The first two requests) Why is that?

*edit* Ohhh I see. It would run on any commit but when reading the config file would only react to branches that match the pattern.

That being said. To correct the error from my understanding I have to put the .travis.yml in the repo root right? What does that mean for the packager? Will he parse all directories and upload all of them at once? If I only make a change to one of the addons all will be updated? How do I do this for specific directories?
For reasons I do not understand, you are using a single repo for multiple projects, which is not how Git was intended to be used, thus no CI tool will be able to understand.
E.g, if you tag the repo (and tags only work on repo-level, as with branches), every project you have in that repo (as you've set it up) will get the same tag.

The packager and Travis expects Git to be used as it was intended; one repo per project, and each project has its own .travis.yml file at the root, and tagging the repo will trigger Travis/packager.
  Reply With Quote
10-25-18, 07:12 AM   #56
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,729
It relates back to Google Code and SVN days. When Google Code closed there was an option to move all of it to Github which I did.

That is why there is one huge mono repo for all of it.

Never saw a reason to change that.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW) | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 10-25-18 at 07:15 AM.
  Reply With Quote
10-25-18, 08:17 AM   #57
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,676
Originally Posted by zork View Post
It relates back to Google Code and SVN days. When Google Code closed there was an option to move all of it to Github which I did.

That is why there is one huge mono repo for all of it.

Never saw a reason to change that.
Git is not SVN, and monolithic repositories comes with a large amount of issues, especially when you want to expand upon just tracking history.
If you ever want to manage dependencies, external tooling, collaboration, or versioning (just to name a few), monorepos is going to become a problem, fast.

My suggestion to you is to spend some time splitting up your single repo into multiple, preferably one per addon, then you'll be able to fully utilize Git as it was intended, which includes being able to use the packager with TravisCI in an automated fashion.

Example of splitting while preserving history: https://www.atlassian.com/blog/git/t...sitory-git-way

Last edited by p3lim : 10-25-18 at 08:25 AM.
  Reply With Quote

WoWInterface » Developer Discussions » Tutorials & Other Helpful Info. » Guide: Automagically package and publish addons

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off