Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make GTFS.zip file available for download #5

Open
1Maxnet1 opened this issue Jun 16, 2023 · 6 comments
Open

Make GTFS.zip file available for download #5

1Maxnet1 opened this issue Jun 16, 2023 · 6 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@1Maxnet1
Copy link

I like the idea of this repository, especially to have a valid GTFS-feed for testing your Software and making sure it is not the GTFS feed which makes a test fail, but rather your software. However, currently it would require my to download/clone the repository and build extract the gtfs.zip from the installed package. So a nice addition to this repo would imho be, if the current feed is available as gfts.zip in the Releases, so one can easily download them, if one is not interested in the module, but only in the sampl-feed.

@derhuerst derhuerst added the question Further information is requested label Jun 16, 2023
@derhuerst
Copy link
Member

It's not very obvious, but you can obtain a .tar.gz of the latest published npm package (which contains the built GTFS feed) using the npm registry API:

curl 'https://registry.npmjs.org/sample-gtfs-feed/latest' -H 'Accept: application/json' -fsSL | jq -rc .dist.tarball
# https://registry.npmjs.org/sample-gtfs-feed/-/sample-gtfs-feed-0.11.2.tgz

# or download it directly:
wget $('curl 'https://registry.npmjs.org/sample-gtfs-feed/latest' -H 'Accept: application/json' -fsSL | jq -rc .dist.tarball')

Do you think we should document this way? (It is less obvious, but less maintenance work for me.)
Or should we use GitHub releases in addition?

@1Maxnet1
Copy link
Author

It's not very obvious, but you can obtain a .tar.gz of the latest published npm package (which contains the built GTFS feed) using the npm registry API:

curl 'https://registry.npmjs.org/sample-gtfs-feed/latest' -H 'Accept: application/json' -fsSL | jq -rc .dist.tarball
# https://registry.npmjs.org/sample-gtfs-feed/-/sample-gtfs-feed-0.11.2.tgz

# or download it directly:
wget $('curl 'https://registry.npmjs.org/sample-gtfs-feed/latest' -H 'Accept: application/json' -fsSL | jq -rc .dist.tarball')

Do you think we should document this way? (It is less obvious, but less maintenance work for me.) Or should we use GitHub releases in addition?

I did not have a closer look, but your given example does not work out-of-the-box in my (ZSH)-Shell. However, in general I would say this is rather more complicated for a user of the GTFS-Feed (although of course little to no maintenance for you). I would say a GitHub Release is more obvious and easier to use. Imagine one could also use this sample-GTFS for beginner tutorials and then downloading it from GitHub releases seems more user-friendly to me.

Or should we use GitHub releases in addition?

As you already tag releases, we could set a GitHub Action which does "just execute the two commands" and upload the GTFS-Feed as artifact to the tag, no? What do you think?

@derhuerst
Copy link
Member

sounds good, PR welcome

@1Maxnet1
Copy link
Author

1Maxnet1 commented Jul 7, 2023

Got it on my to do list, will submit a PR soon :)

@1Maxnet1
Copy link
Author

I gave it some tries, but couldn't get it to work easily (https://github.com/1Maxnet1/sample-gtfs-feed/tree/add-gtfs-to-release) as I'm not that much experienced with GitHub Actions (yet). As it seems more work then I supposed, I will probably pause my work for now, keeping my branch for reference and will maybe come back to it, when I find time and will or have more experience with GitHub Actions :)

@derhuerst
Copy link
Member

derhuerst commented Aug 28, 2023

You don't have to download the .tar.gz file from npm.
Instead, on push of a Git tag (e.g. 0.11.2), in a GitHub Actions workflow, you can

  1. Run npm run build to generate gtfs/*.txt.
  2. Zip all files (sth. like zip -9 -j sample-gtfs-feed.zip gtfs/*.txt).
  3. Create the release using the softprops/action-gh-release@v1 Action you're already using.

@derhuerst derhuerst added enhancement New feature or request help wanted Extra attention is needed and removed question Further information is requested labels Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Development

No branches or pull requests

2 participants