WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Tutorials & Other Helpful Info. (https://www.wowinterface.com/forums/forumdisplay.php?f=12)
-   -   Guide: Automagically package and publish addons (https://www.wowinterface.com/forums/showthread.php?t=55801)

p3lim 08-11-18 01:34 PM

Quote:

Originally Posted by StormFX (Post 329242)
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.)

Xruptor 08-12-18 02:27 PM

Quote:

Originally Posted by p3lim (Post 329465)
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 :)

p3lim 08-12-18 02:30 PM

Quote:

Originally Posted by Xruptor (Post 329507)
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.

Dajn 08-31-18 11:30 AM

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

p3lim 08-31-18 11:38 AM

Quote:

Originally Posted by Dajn (Post 329940)
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.

Dajn 08-31-18 12:39 PM

Quote:

Originally Posted by p3lim (Post 329942)
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

Xruptor 10-01-18 03:53 PM

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 :D

Xruptor 10-01-18 04:09 PM

Lol!!!!
 
Quote:

Originally Posted by p3lim (Post 325496)
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.

p3lim 10-01-18 10:16 PM

Quote:

Originally Posted by Xruptor (Post 330323)
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 :).

Rythal 10-24-18 01:02 PM

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? :)

p3lim 10-24-18 01:17 PM

1 Attachment(s)
Quote:

Originally Posted by Rythal (Post 330572)
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?

Rythal 10-24-18 01:50 PM

Quote:

Originally Posted by p3lim (Post 330573)
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

p3lim 10-24-18 02:04 PM

Quote:

Originally Posted by Rythal (Post 330576)
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 ;))

zork 10-25-18 06:36 AM

3 Attachment(s)
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?

p3lim 10-25-18 07:11 AM

Quote:

Originally Posted by zork (Post 330594)
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.

zork 10-25-18 07:12 AM

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.

p3lim 10-25-18 08:17 AM

Quote:

Originally Posted by zork (Post 330596)
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

Aiue 09-28-19 01:03 PM

Right, it would appear I'm doing something wrong with git, and I can't quite figure out what, so I'm turning here for help. Even tagging exactly in the manner suggested in the op, I keep tripping this:

Code:

        if [ -z "$TRAVIS_TAG" ]; then
                # don't need to run the packager if there is a tag pending
                TRAVIS_TAG=$( git -C "$TRAVIS_BUILD_DIR" tag --points-at )
                if [ -n "$TRAVIS_TAG" ]; then
                        echo "Found future tag \"${TRAVIS_TAG}\", not packaging."
                        exit 0
                fi

Which means the packager will only run if I have no tag (as I currently have it configured to do that, as, well, it's gotta run on something.)

I'm sure there's something obvious I'm missing, but I'm stumped, so any help would be appreciated.

The repo in question is at https://github.com/Aiue/AQT, in case an extra set of eyes looking at stuff helps.

Aiue 09-28-19 02:38 PM

Quote:

Originally Posted by Aiue (Post 334031)
Which means the packager will only run if I have no tag (as I currently have it configured to do that, as, well, it's gotta run on something.)

Turns out this was the issue. Setting it to run on anything will cause this. I guess that's what I get for not following instructions explicitly and improvising.

MooreaTv 09-30-19 12:14 PM

You can use Github Actions (just need to signup for it and afaik everyone asking gets immediate access to it) to run the packager with no other dependencies

here is an example:
https://github.com/mooreatv/AuctionD...packaging.yaml


All times are GMT -6. The time now is 03:17 AM.

vBulletin © 2020, Jelsoft Enterprises Ltd
© 2004 - 2020 MMOUI