From 386980e22b20d82471f64474e932614b5d22dfa9 Mon Sep 17 00:00:00 2001 From: Shohei Ueda <30958501+peaceiris@users.noreply.github.com> Date: Sat, 18 Jan 2020 10:29:06 +0900 Subject: [PATCH] test: Add integration testing (#131) * docs: Update description * deps: Add nock * chore: Add resolveJsonModule * test: Add integration testing * chore: Add @typescript-eslint/eslint-plugin * refactor: Fix lint errors * chore: Add eslint-plugin-jest * refactor: Fix lint errors * test: Add remove working files * ci: Comment out cache steps --- .eslintrc.json | 7 +- .github/workflows/test.yml | 24 +- README.md | 8 +- __tests__/data/brew.json | 1 + __tests__/data/github.json | 958 +++++++++++++++++++++++++++++++++++++ __tests__/main.test.ts | 62 +++ package-lock.json | 112 +++++ package.json | 7 +- src/constants.ts | 7 + src/get-latest-version.ts | 4 +- src/get-os.ts | 2 +- src/get-url.ts | 12 +- src/index.ts | 68 +-- src/installer.ts | 4 +- src/main.ts | 65 +++ tsconfig.json | 4 +- 16 files changed, 1249 insertions(+), 96 deletions(-) create mode 100644 __tests__/data/brew.json create mode 100644 __tests__/data/github.json create mode 100644 __tests__/main.test.ts create mode 100644 src/constants.ts create mode 100644 src/main.ts diff --git a/.eslintrc.json b/.eslintrc.json index f8f61db..f494001 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -4,7 +4,12 @@ "es6": true, "node": true }, - "extends": "eslint:recommended", + "extends": [ + "eslint:recommended", + "plugin:@typescript-eslint/recommended", + "plugin:@typescript-eslint/recommended", + "plugin:jest/recommended" + ], "globals": { "Atomics": "readonly", "SharedArrayBuffer": "readonly" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0242a0d..49a7f3c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -41,18 +41,18 @@ jobs: with: node-version: '${{ steps.nvm.outputs.NVMRC }}' - - name: Get npm cache directory - id: npm-cache - run: | - echo "::set-output name=dir::$(npm config get cache)" - - - name: Cache npm - uses: actions/cache@v1 - with: - path: ${{ steps.npm-cache.outputs.dir }} - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node- +# - name: Get npm cache directory +# id: npm-cache +# run: | +# echo "::set-output name=dir::$(npm config get cache)" +# +# - name: Cache npm +# uses: actions/cache@v1 +# with: +# path: ${{ steps.npm-cache.outputs.dir }} +# key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} +# restore-keys: | +# ${{ runner.os }}-node- - run: npm ci diff --git a/README.md b/README.md index 8abac44..a841933 100644 --- a/README.md +++ b/README.md @@ -13,9 +13,13 @@ - [gohugoio/hugo: The world’s fastest framework for building websites.](https://github.com/gohugoio/hugo) -We can run **Hugo** on a virtual machine of **GitHub Actions** by this Hugo action. **Hugo extended** version and **Hugo Modules** are supported. +This **Hugo Setup Action** can install **Hugo** to a virtual machine of **GitHub Actions**. +**Hugo extended** version, **Hugo Modules**, Linux (Ubuntu), macOS, and Windows are supported. -From `v2`, this Hugo action migrated to a JavaScript (TypeScript) action. We no longer build or pull a Hugo docker image. Thanks to this change, we can complete this action less than **1 sec**. (A docker base action was taking about 1 min or more execution time to build or pull.) +From `v2`, this Hugo Setup Action has migrated to a JavaScript (TypeScript) action. +We no longer build or pull a Hugo docker image. +Thanks to this change, we can complete this action less than **1 sec**. +(A docker base action was taking about 1 min or more execution time to build and pull a docker image.) | OS (runs-on) | ubuntu-18.04 | macos-latest | windows-2019 | |---|:---:|:---:|:---:| diff --git a/__tests__/data/brew.json b/__tests__/data/brew.json new file mode 100644 index 0000000..2e23b84 --- /dev/null +++ b/__tests__/data/brew.json @@ -0,0 +1 @@ +{"name":"hugo","full_name":"hugo","oldname":null,"aliases":[],"versioned_formulae":[],"desc":"Configurable static site generator","homepage":"https://gohugo.io/","versions":{"stable":"0.62.2","devel":null,"head":"HEAD","bottle":true},"revision":0,"version_scheme":0,"bottle":{"stable":{"rebuild":0,"cellar":":any_skip_relocation","prefix":"/usr/local","root_url":"https://homebrew.bintray.com/bottles","files":{"catalina":{"url":"https://homebrew.bintray.com/bottles/hugo-0.62.2.catalina.bottle.tar.gz","sha256":"354545c2c125e01a8860f83577fb4218d585fa8d38cd7f51e4228a149347fbcf"},"mojave":{"url":"https://homebrew.bintray.com/bottles/hugo-0.62.2.mojave.bottle.tar.gz","sha256":"9645b64fe6290c4c3b7591ef21139247f0fad6e49da1edd01665b3130a8f1d1a"},"high_sierra":{"url":"https://homebrew.bintray.com/bottles/hugo-0.62.2.high_sierra.bottle.tar.gz","sha256":"0ede4cbcc7536dd6b05107376637840356062273d734b4106be98b3d1732d50c"}}}},"keg_only":false,"bottle_disabled":false,"options":[],"build_dependencies":["go"],"dependencies":[],"recommended_dependencies":[],"optional_dependencies":[],"uses_from_macos":[],"requirements":[],"conflicts_with":[],"caveats":null,"installed":[],"linked_keg":null,"pinned":false,"outdated":false,"analytics":{"install":{"30d":{"hugo":24278,"hugo --HEAD":30},"90d":{"hugo":68639,"hugo --HEAD":80},"365d":{"hugo":223748,"hugo --HEAD":321}},"install_on_request":{"30d":{"hugo":23621,"hugo --HEAD":27},"90d":{"hugo":66676,"hugo --HEAD":74},"365d":{"hugo":215985,"hugo --HEAD":305}},"build_error":{"30d":{"hugo":0}}}} diff --git a/__tests__/data/github.json b/__tests__/data/github.json new file mode 100644 index 0000000..5fd1e31 --- /dev/null +++ b/__tests__/data/github.json @@ -0,0 +1,958 @@ +{ + "url": "https://api.github.com/repos/gohugoio/hugo/releases/22603992", + "assets_url": "https://api.github.com/repos/gohugoio/hugo/releases/22603992/assets", + "upload_url": "https://uploads.github.com/repos/gohugoio/hugo/releases/22603992/assets{?name,label}", + "html_url": "https://github.com/gohugoio/hugo/releases/tag/v0.62.2", + "id": 22603992, + "node_id": "MDc6UmVsZWFzZTIyNjAzOTky", + "tag_name": "v0.62.2", + "target_commitish": "master", + "name": "v0.62.2", + "draft": false, + "author": { + "login": "bep", + "id": 394382, + "node_id": "MDQ6VXNlcjM5NDM4Mg==", + "avatar_url": "https://avatars1.githubusercontent.com/u/394382?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bep", + "html_url": "https://github.com/bep", + "followers_url": "https://api.github.com/users/bep/followers", + "following_url": "https://api.github.com/users/bep/following{/other_user}", + "gists_url": "https://api.github.com/users/bep/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bep/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bep/subscriptions", + "organizations_url": "https://api.github.com/users/bep/orgs", + "repos_url": "https://api.github.com/users/bep/repos", + "events_url": "https://api.github.com/users/bep/events{/privacy}", + "received_events_url": "https://api.github.com/users/bep/received_events", + "type": "User", + "site_admin": false + }, + "prerelease": false, + "created_at": "2020-01-05T18:50:35Z", + "published_at": "2020-01-05T19:35:16Z", + "assets": [ + { + "url": "https://api.github.com/repos/gohugoio/hugo/releases/assets/17152845", + "id": 17152845, + "node_id": "MDEyOlJlbGVhc2VBc3NldDE3MTUyODQ1", + "name": "hugo_0.62.2_checksums.txt", + "label": "", + "uploader": { + "login": "bep", + "id": 394382, + "node_id": "MDQ6VXNlcjM5NDM4Mg==", + "avatar_url": "https://avatars1.githubusercontent.com/u/394382?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bep", + "html_url": "https://github.com/bep", + "followers_url": "https://api.github.com/users/bep/followers", + "following_url": "https://api.github.com/users/bep/following{/other_user}", + "gists_url": "https://api.github.com/users/bep/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bep/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bep/subscriptions", + "organizations_url": "https://api.github.com/users/bep/orgs", + "repos_url": "https://api.github.com/users/bep/repos", + "events_url": "https://api.github.com/users/bep/events{/privacy}", + "received_events_url": "https://api.github.com/users/bep/received_events", + "type": "User", + "site_admin": false + }, + "content_type": "text/plain; charset=utf-8", + "state": "uploaded", + "size": 2552, + "download_count": 328, + "created_at": "2020-01-05T18:58:47Z", + "updated_at": "2020-01-05T18:58:47Z", + "browser_download_url": "https://github.com/gohugoio/hugo/releases/download/v0.62.2/hugo_0.62.2_checksums.txt" + }, + { + "url": "https://api.github.com/repos/gohugoio/hugo/releases/assets/17152874", + "id": 17152874, + "node_id": "MDEyOlJlbGVhc2VBc3NldDE3MTUyODc0", + "name": "hugo_0.62.2_DragonFlyBSD-64bit.tar.gz", + "label": "", + "uploader": { + "login": "bep", + "id": 394382, + "node_id": "MDQ6VXNlcjM5NDM4Mg==", + "avatar_url": "https://avatars1.githubusercontent.com/u/394382?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bep", + "html_url": "https://github.com/bep", + "followers_url": "https://api.github.com/users/bep/followers", + "following_url": "https://api.github.com/users/bep/following{/other_user}", + "gists_url": "https://api.github.com/users/bep/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bep/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bep/subscriptions", + "organizations_url": "https://api.github.com/users/bep/orgs", + "repos_url": "https://api.github.com/users/bep/repos", + "events_url": "https://api.github.com/users/bep/events{/privacy}", + "received_events_url": "https://api.github.com/users/bep/received_events", + "type": "User", + "site_admin": false + }, + "content_type": "application/gzip", + "state": "uploaded", + "size": 13188250, + "download_count": 25, + "created_at": "2020-01-05T18:58:52Z", + "updated_at": "2020-01-05T18:58:52Z", + "browser_download_url": "https://github.com/gohugoio/hugo/releases/download/v0.62.2/hugo_0.62.2_DragonFlyBSD-64bit.tar.gz" + }, + { + "url": "https://api.github.com/repos/gohugoio/hugo/releases/assets/17152867", + "id": 17152867, + "node_id": "MDEyOlJlbGVhc2VBc3NldDE3MTUyODY3", + "name": "hugo_0.62.2_FreeBSD-32bit.tar.gz", + "label": "", + "uploader": { + "login": "bep", + "id": 394382, + "node_id": "MDQ6VXNlcjM5NDM4Mg==", + "avatar_url": "https://avatars1.githubusercontent.com/u/394382?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bep", + "html_url": "https://github.com/bep", + "followers_url": "https://api.github.com/users/bep/followers", + "following_url": "https://api.github.com/users/bep/following{/other_user}", + "gists_url": "https://api.github.com/users/bep/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bep/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bep/subscriptions", + "organizations_url": "https://api.github.com/users/bep/orgs", + "repos_url": "https://api.github.com/users/bep/repos", + "events_url": "https://api.github.com/users/bep/events{/privacy}", + "received_events_url": "https://api.github.com/users/bep/received_events", + "type": "User", + "site_admin": false + }, + "content_type": "application/gzip", + "state": "uploaded", + "size": 12223449, + "download_count": 10, + "created_at": "2020-01-05T18:58:50Z", + "updated_at": "2020-01-05T18:58:53Z", + "browser_download_url": "https://github.com/gohugoio/hugo/releases/download/v0.62.2/hugo_0.62.2_FreeBSD-32bit.tar.gz" + }, + { + "url": "https://api.github.com/repos/gohugoio/hugo/releases/assets/17152850", + "id": 17152850, + "node_id": "MDEyOlJlbGVhc2VBc3NldDE3MTUyODUw", + "name": "hugo_0.62.2_FreeBSD-64bit.tar.gz", + "label": "", + "uploader": { + "login": "bep", + "id": 394382, + "node_id": "MDQ6VXNlcjM5NDM4Mg==", + "avatar_url": "https://avatars1.githubusercontent.com/u/394382?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bep", + "html_url": "https://github.com/bep", + "followers_url": "https://api.github.com/users/bep/followers", + "following_url": "https://api.github.com/users/bep/following{/other_user}", + "gists_url": "https://api.github.com/users/bep/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bep/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bep/subscriptions", + "organizations_url": "https://api.github.com/users/bep/orgs", + "repos_url": "https://api.github.com/users/bep/repos", + "events_url": "https://api.github.com/users/bep/events{/privacy}", + "received_events_url": "https://api.github.com/users/bep/received_events", + "type": "User", + "site_admin": false + }, + "content_type": "application/gzip", + "state": "uploaded", + "size": 13195767, + "download_count": 38, + "created_at": "2020-01-05T18:58:47Z", + "updated_at": "2020-01-05T18:58:48Z", + "browser_download_url": "https://github.com/gohugoio/hugo/releases/download/v0.62.2/hugo_0.62.2_FreeBSD-64bit.tar.gz" + }, + { + "url": "https://api.github.com/repos/gohugoio/hugo/releases/assets/17152869", + "id": 17152869, + "node_id": "MDEyOlJlbGVhc2VBc3NldDE3MTUyODY5", + "name": "hugo_0.62.2_FreeBSD-ARM.tar.gz", + "label": "", + "uploader": { + "login": "bep", + "id": 394382, + "node_id": "MDQ6VXNlcjM5NDM4Mg==", + "avatar_url": "https://avatars1.githubusercontent.com/u/394382?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bep", + "html_url": "https://github.com/bep", + "followers_url": "https://api.github.com/users/bep/followers", + "following_url": "https://api.github.com/users/bep/following{/other_user}", + "gists_url": "https://api.github.com/users/bep/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bep/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bep/subscriptions", + "organizations_url": "https://api.github.com/users/bep/orgs", + "repos_url": "https://api.github.com/users/bep/repos", + "events_url": "https://api.github.com/users/bep/events{/privacy}", + "received_events_url": "https://api.github.com/users/bep/received_events", + "type": "User", + "site_admin": false + }, + "content_type": "application/gzip", + "state": "uploaded", + "size": 12336796, + "download_count": 12, + "created_at": "2020-01-05T18:58:50Z", + "updated_at": "2020-01-05T18:58:51Z", + "browser_download_url": "https://github.com/gohugoio/hugo/releases/download/v0.62.2/hugo_0.62.2_FreeBSD-ARM.tar.gz" + }, + { + "url": "https://api.github.com/repos/gohugoio/hugo/releases/assets/17152855", + "id": 17152855, + "node_id": "MDEyOlJlbGVhc2VBc3NldDE3MTUyODU1", + "name": "hugo_0.62.2_Linux-32bit.deb", + "label": "", + "uploader": { + "login": "bep", + "id": 394382, + "node_id": "MDQ6VXNlcjM5NDM4Mg==", + "avatar_url": "https://avatars1.githubusercontent.com/u/394382?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bep", + "html_url": "https://github.com/bep", + "followers_url": "https://api.github.com/users/bep/followers", + "following_url": "https://api.github.com/users/bep/following{/other_user}", + "gists_url": "https://api.github.com/users/bep/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bep/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bep/subscriptions", + "organizations_url": "https://api.github.com/users/bep/orgs", + "repos_url": "https://api.github.com/users/bep/repos", + "events_url": "https://api.github.com/users/bep/events{/privacy}", + "received_events_url": "https://api.github.com/users/bep/received_events", + "type": "User", + "site_admin": false + }, + "content_type": "application/x-debian-package", + "state": "uploaded", + "size": 12226680, + "download_count": 37, + "created_at": "2020-01-05T18:58:48Z", + "updated_at": "2020-01-05T18:58:55Z", + "browser_download_url": "https://github.com/gohugoio/hugo/releases/download/v0.62.2/hugo_0.62.2_Linux-32bit.deb" + }, + { + "url": "https://api.github.com/repos/gohugoio/hugo/releases/assets/17152849", + "id": 17152849, + "node_id": "MDEyOlJlbGVhc2VBc3NldDE3MTUyODQ5", + "name": "hugo_0.62.2_Linux-32bit.tar.gz", + "label": "", + "uploader": { + "login": "bep", + "id": 394382, + "node_id": "MDQ6VXNlcjM5NDM4Mg==", + "avatar_url": "https://avatars1.githubusercontent.com/u/394382?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bep", + "html_url": "https://github.com/bep", + "followers_url": "https://api.github.com/users/bep/followers", + "following_url": "https://api.github.com/users/bep/following{/other_user}", + "gists_url": "https://api.github.com/users/bep/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bep/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bep/subscriptions", + "organizations_url": "https://api.github.com/users/bep/orgs", + "repos_url": "https://api.github.com/users/bep/repos", + "events_url": "https://api.github.com/users/bep/events{/privacy}", + "received_events_url": "https://api.github.com/users/bep/received_events", + "type": "User", + "site_admin": false + }, + "content_type": "application/gzip", + "state": "uploaded", + "size": 12228575, + "download_count": 31, + "created_at": "2020-01-05T18:58:47Z", + "updated_at": "2020-01-05T18:58:48Z", + "browser_download_url": "https://github.com/gohugoio/hugo/releases/download/v0.62.2/hugo_0.62.2_Linux-32bit.tar.gz" + }, + { + "url": "https://api.github.com/repos/gohugoio/hugo/releases/assets/17152858", + "id": 17152858, + "node_id": "MDEyOlJlbGVhc2VBc3NldDE3MTUyODU4", + "name": "hugo_0.62.2_Linux-64bit.deb", + "label": "", + "uploader": { + "login": "bep", + "id": 394382, + "node_id": "MDQ6VXNlcjM5NDM4Mg==", + "avatar_url": "https://avatars1.githubusercontent.com/u/394382?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bep", + "html_url": "https://github.com/bep", + "followers_url": "https://api.github.com/users/bep/followers", + "following_url": "https://api.github.com/users/bep/following{/other_user}", + "gists_url": "https://api.github.com/users/bep/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bep/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bep/subscriptions", + "organizations_url": "https://api.github.com/users/bep/orgs", + "repos_url": "https://api.github.com/users/bep/repos", + "events_url": "https://api.github.com/users/bep/events{/privacy}", + "received_events_url": "https://api.github.com/users/bep/received_events", + "type": "User", + "site_admin": false + }, + "content_type": "application/x-debian-package", + "state": "uploaded", + "size": 13182646, + "download_count": 2260, + "created_at": "2020-01-05T18:58:49Z", + "updated_at": "2020-01-05T18:58:49Z", + "browser_download_url": "https://github.com/gohugoio/hugo/releases/download/v0.62.2/hugo_0.62.2_Linux-64bit.deb" + }, + { + "url": "https://api.github.com/repos/gohugoio/hugo/releases/assets/17152851", + "id": 17152851, + "node_id": "MDEyOlJlbGVhc2VBc3NldDE3MTUyODUx", + "name": "hugo_0.62.2_Linux-64bit.tar.gz", + "label": "", + "uploader": { + "login": "bep", + "id": 394382, + "node_id": "MDQ6VXNlcjM5NDM4Mg==", + "avatar_url": "https://avatars1.githubusercontent.com/u/394382?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bep", + "html_url": "https://github.com/bep", + "followers_url": "https://api.github.com/users/bep/followers", + "following_url": "https://api.github.com/users/bep/following{/other_user}", + "gists_url": "https://api.github.com/users/bep/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bep/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bep/subscriptions", + "organizations_url": "https://api.github.com/users/bep/orgs", + "repos_url": "https://api.github.com/users/bep/repos", + "events_url": "https://api.github.com/users/bep/events{/privacy}", + "received_events_url": "https://api.github.com/users/bep/received_events", + "type": "User", + "site_admin": false + }, + "content_type": "application/gzip", + "state": "uploaded", + "size": 13192573, + "download_count": 5752, + "created_at": "2020-01-05T18:58:47Z", + "updated_at": "2020-01-05T18:58:48Z", + "browser_download_url": "https://github.com/gohugoio/hugo/releases/download/v0.62.2/hugo_0.62.2_Linux-64bit.tar.gz" + }, + { + "url": "https://api.github.com/repos/gohugoio/hugo/releases/assets/17152856", + "id": 17152856, + "node_id": "MDEyOlJlbGVhc2VBc3NldDE3MTUyODU2", + "name": "hugo_0.62.2_Linux-ARM.deb", + "label": "", + "uploader": { + "login": "bep", + "id": 394382, + "node_id": "MDQ6VXNlcjM5NDM4Mg==", + "avatar_url": "https://avatars1.githubusercontent.com/u/394382?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bep", + "html_url": "https://github.com/bep", + "followers_url": "https://api.github.com/users/bep/followers", + "following_url": "https://api.github.com/users/bep/following{/other_user}", + "gists_url": "https://api.github.com/users/bep/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bep/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bep/subscriptions", + "organizations_url": "https://api.github.com/users/bep/orgs", + "repos_url": "https://api.github.com/users/bep/repos", + "events_url": "https://api.github.com/users/bep/events{/privacy}", + "received_events_url": "https://api.github.com/users/bep/received_events", + "type": "User", + "site_admin": false + }, + "content_type": "application/x-debian-package", + "state": "uploaded", + "size": 12324130, + "download_count": 47, + "created_at": "2020-01-05T18:58:48Z", + "updated_at": "2020-01-05T18:58:49Z", + "browser_download_url": "https://github.com/gohugoio/hugo/releases/download/v0.62.2/hugo_0.62.2_Linux-ARM.deb" + }, + { + "url": "https://api.github.com/repos/gohugoio/hugo/releases/assets/17152854", + "id": 17152854, + "node_id": "MDEyOlJlbGVhc2VBc3NldDE3MTUyODU0", + "name": "hugo_0.62.2_Linux-ARM.tar.gz", + "label": "", + "uploader": { + "login": "bep", + "id": 394382, + "node_id": "MDQ6VXNlcjM5NDM4Mg==", + "avatar_url": "https://avatars1.githubusercontent.com/u/394382?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bep", + "html_url": "https://github.com/bep", + "followers_url": "https://api.github.com/users/bep/followers", + "following_url": "https://api.github.com/users/bep/following{/other_user}", + "gists_url": "https://api.github.com/users/bep/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bep/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bep/subscriptions", + "organizations_url": "https://api.github.com/users/bep/orgs", + "repos_url": "https://api.github.com/users/bep/repos", + "events_url": "https://api.github.com/users/bep/events{/privacy}", + "received_events_url": "https://api.github.com/users/bep/received_events", + "type": "User", + "site_admin": false + }, + "content_type": "application/gzip", + "state": "uploaded", + "size": 12330563, + "download_count": 35, + "created_at": "2020-01-05T18:58:48Z", + "updated_at": "2020-01-05T18:58:48Z", + "browser_download_url": "https://github.com/gohugoio/hugo/releases/download/v0.62.2/hugo_0.62.2_Linux-ARM.tar.gz" + }, + { + "url": "https://api.github.com/repos/gohugoio/hugo/releases/assets/17152857", + "id": 17152857, + "node_id": "MDEyOlJlbGVhc2VBc3NldDE3MTUyODU3", + "name": "hugo_0.62.2_Linux-ARM64.deb", + "label": "", + "uploader": { + "login": "bep", + "id": 394382, + "node_id": "MDQ6VXNlcjM5NDM4Mg==", + "avatar_url": "https://avatars1.githubusercontent.com/u/394382?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bep", + "html_url": "https://github.com/bep", + "followers_url": "https://api.github.com/users/bep/followers", + "following_url": "https://api.github.com/users/bep/following{/other_user}", + "gists_url": "https://api.github.com/users/bep/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bep/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bep/subscriptions", + "organizations_url": "https://api.github.com/users/bep/orgs", + "repos_url": "https://api.github.com/users/bep/repos", + "events_url": "https://api.github.com/users/bep/events{/privacy}", + "received_events_url": "https://api.github.com/users/bep/received_events", + "type": "User", + "site_admin": false + }, + "content_type": "application/x-debian-package", + "state": "uploaded", + "size": 12113228, + "download_count": 38, + "created_at": "2020-01-05T18:58:49Z", + "updated_at": "2020-01-05T18:58:49Z", + "browser_download_url": "https://github.com/gohugoio/hugo/releases/download/v0.62.2/hugo_0.62.2_Linux-ARM64.deb" + }, + { + "url": "https://api.github.com/repos/gohugoio/hugo/releases/assets/17152843", + "id": 17152843, + "node_id": "MDEyOlJlbGVhc2VBc3NldDE3MTUyODQz", + "name": "hugo_0.62.2_Linux-ARM64.tar.gz", + "label": "", + "uploader": { + "login": "bep", + "id": 394382, + "node_id": "MDQ6VXNlcjM5NDM4Mg==", + "avatar_url": "https://avatars1.githubusercontent.com/u/394382?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bep", + "html_url": "https://github.com/bep", + "followers_url": "https://api.github.com/users/bep/followers", + "following_url": "https://api.github.com/users/bep/following{/other_user}", + "gists_url": "https://api.github.com/users/bep/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bep/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bep/subscriptions", + "organizations_url": "https://api.github.com/users/bep/orgs", + "repos_url": "https://api.github.com/users/bep/repos", + "events_url": "https://api.github.com/users/bep/events{/privacy}", + "received_events_url": "https://api.github.com/users/bep/received_events", + "type": "User", + "site_admin": false + }, + "content_type": "application/gzip", + "state": "uploaded", + "size": 12119126, + "download_count": 63, + "created_at": "2020-01-05T18:58:47Z", + "updated_at": "2020-01-05T18:58:47Z", + "browser_download_url": "https://github.com/gohugoio/hugo/releases/download/v0.62.2/hugo_0.62.2_Linux-ARM64.tar.gz" + }, + { + "url": "https://api.github.com/repos/gohugoio/hugo/releases/assets/17152873", + "id": 17152873, + "node_id": "MDEyOlJlbGVhc2VBc3NldDE3MTUyODcz", + "name": "hugo_0.62.2_macOS-32bit.tar.gz", + "label": "", + "uploader": { + "login": "bep", + "id": 394382, + "node_id": "MDQ6VXNlcjM5NDM4Mg==", + "avatar_url": "https://avatars1.githubusercontent.com/u/394382?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bep", + "html_url": "https://github.com/bep", + "followers_url": "https://api.github.com/users/bep/followers", + "following_url": "https://api.github.com/users/bep/following{/other_user}", + "gists_url": "https://api.github.com/users/bep/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bep/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bep/subscriptions", + "organizations_url": "https://api.github.com/users/bep/orgs", + "repos_url": "https://api.github.com/users/bep/repos", + "events_url": "https://api.github.com/users/bep/events{/privacy}", + "received_events_url": "https://api.github.com/users/bep/received_events", + "type": "User", + "site_admin": false + }, + "content_type": "application/gzip", + "state": "uploaded", + "size": 12805086, + "download_count": 25, + "created_at": "2020-01-05T18:58:52Z", + "updated_at": "2020-01-05T18:58:52Z", + "browser_download_url": "https://github.com/gohugoio/hugo/releases/download/v0.62.2/hugo_0.62.2_macOS-32bit.tar.gz" + }, + { + "url": "https://api.github.com/repos/gohugoio/hugo/releases/assets/17152868", + "id": 17152868, + "node_id": "MDEyOlJlbGVhc2VBc3NldDE3MTUyODY4", + "name": "hugo_0.62.2_macOS-64bit.tar.gz", + "label": "", + "uploader": { + "login": "bep", + "id": 394382, + "node_id": "MDQ6VXNlcjM5NDM4Mg==", + "avatar_url": "https://avatars1.githubusercontent.com/u/394382?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bep", + "html_url": "https://github.com/bep", + "followers_url": "https://api.github.com/users/bep/followers", + "following_url": "https://api.github.com/users/bep/following{/other_user}", + "gists_url": "https://api.github.com/users/bep/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bep/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bep/subscriptions", + "organizations_url": "https://api.github.com/users/bep/orgs", + "repos_url": "https://api.github.com/users/bep/repos", + "events_url": "https://api.github.com/users/bep/events{/privacy}", + "received_events_url": "https://api.github.com/users/bep/received_events", + "type": "User", + "site_admin": false + }, + "content_type": "application/gzip", + "state": "uploaded", + "size": 13765882, + "download_count": 479, + "created_at": "2020-01-05T18:58:50Z", + "updated_at": "2020-01-05T18:58:51Z", + "browser_download_url": "https://github.com/gohugoio/hugo/releases/download/v0.62.2/hugo_0.62.2_macOS-64bit.tar.gz" + }, + { + "url": "https://api.github.com/repos/gohugoio/hugo/releases/assets/17152846", + "id": 17152846, + "node_id": "MDEyOlJlbGVhc2VBc3NldDE3MTUyODQ2", + "name": "hugo_0.62.2_NetBSD-32bit.tar.gz", + "label": "", + "uploader": { + "login": "bep", + "id": 394382, + "node_id": "MDQ6VXNlcjM5NDM4Mg==", + "avatar_url": "https://avatars1.githubusercontent.com/u/394382?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bep", + "html_url": "https://github.com/bep", + "followers_url": "https://api.github.com/users/bep/followers", + "following_url": "https://api.github.com/users/bep/following{/other_user}", + "gists_url": "https://api.github.com/users/bep/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bep/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bep/subscriptions", + "organizations_url": "https://api.github.com/users/bep/orgs", + "repos_url": "https://api.github.com/users/bep/repos", + "events_url": "https://api.github.com/users/bep/events{/privacy}", + "received_events_url": "https://api.github.com/users/bep/received_events", + "type": "User", + "site_admin": false + }, + "content_type": "application/gzip", + "state": "uploaded", + "size": 12206852, + "download_count": 8, + "created_at": "2020-01-05T18:58:47Z", + "updated_at": "2020-01-05T18:58:47Z", + "browser_download_url": "https://github.com/gohugoio/hugo/releases/download/v0.62.2/hugo_0.62.2_NetBSD-32bit.tar.gz" + }, + { + "url": "https://api.github.com/repos/gohugoio/hugo/releases/assets/17152863", + "id": 17152863, + "node_id": "MDEyOlJlbGVhc2VBc3NldDE3MTUyODYz", + "name": "hugo_0.62.2_NetBSD-64bit.tar.gz", + "label": "", + "uploader": { + "login": "bep", + "id": 394382, + "node_id": "MDQ6VXNlcjM5NDM4Mg==", + "avatar_url": "https://avatars1.githubusercontent.com/u/394382?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bep", + "html_url": "https://github.com/bep", + "followers_url": "https://api.github.com/users/bep/followers", + "following_url": "https://api.github.com/users/bep/following{/other_user}", + "gists_url": "https://api.github.com/users/bep/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bep/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bep/subscriptions", + "organizations_url": "https://api.github.com/users/bep/orgs", + "repos_url": "https://api.github.com/users/bep/repos", + "events_url": "https://api.github.com/users/bep/events{/privacy}", + "received_events_url": "https://api.github.com/users/bep/received_events", + "type": "User", + "site_admin": false + }, + "content_type": "application/gzip", + "state": "uploaded", + "size": 13186059, + "download_count": 12, + "created_at": "2020-01-05T18:58:49Z", + "updated_at": "2020-01-05T18:58:50Z", + "browser_download_url": "https://github.com/gohugoio/hugo/releases/download/v0.62.2/hugo_0.62.2_NetBSD-64bit.tar.gz" + }, + { + "url": "https://api.github.com/repos/gohugoio/hugo/releases/assets/17152870", + "id": 17152870, + "node_id": "MDEyOlJlbGVhc2VBc3NldDE3MTUyODcw", + "name": "hugo_0.62.2_NetBSD-ARM.tar.gz", + "label": "", + "uploader": { + "login": "bep", + "id": 394382, + "node_id": "MDQ6VXNlcjM5NDM4Mg==", + "avatar_url": "https://avatars1.githubusercontent.com/u/394382?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bep", + "html_url": "https://github.com/bep", + "followers_url": "https://api.github.com/users/bep/followers", + "following_url": "https://api.github.com/users/bep/following{/other_user}", + "gists_url": "https://api.github.com/users/bep/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bep/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bep/subscriptions", + "organizations_url": "https://api.github.com/users/bep/orgs", + "repos_url": "https://api.github.com/users/bep/repos", + "events_url": "https://api.github.com/users/bep/events{/privacy}", + "received_events_url": "https://api.github.com/users/bep/received_events", + "type": "User", + "site_admin": false + }, + "content_type": "application/gzip", + "state": "uploaded", + "size": 12325194, + "download_count": 8, + "created_at": "2020-01-05T18:58:51Z", + "updated_at": "2020-01-05T18:58:52Z", + "browser_download_url": "https://github.com/gohugoio/hugo/releases/download/v0.62.2/hugo_0.62.2_NetBSD-ARM.tar.gz" + }, + { + "url": "https://api.github.com/repos/gohugoio/hugo/releases/assets/17152861", + "id": 17152861, + "node_id": "MDEyOlJlbGVhc2VBc3NldDE3MTUyODYx", + "name": "hugo_0.62.2_OpenBSD-32bit.tar.gz", + "label": "", + "uploader": { + "login": "bep", + "id": 394382, + "node_id": "MDQ6VXNlcjM5NDM4Mg==", + "avatar_url": "https://avatars1.githubusercontent.com/u/394382?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bep", + "html_url": "https://github.com/bep", + "followers_url": "https://api.github.com/users/bep/followers", + "following_url": "https://api.github.com/users/bep/following{/other_user}", + "gists_url": "https://api.github.com/users/bep/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bep/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bep/subscriptions", + "organizations_url": "https://api.github.com/users/bep/orgs", + "repos_url": "https://api.github.com/users/bep/repos", + "events_url": "https://api.github.com/users/bep/events{/privacy}", + "received_events_url": "https://api.github.com/users/bep/received_events", + "type": "User", + "site_admin": false + }, + "content_type": "application/gzip", + "state": "uploaded", + "size": 12208022, + "download_count": 11, + "created_at": "2020-01-05T18:58:49Z", + "updated_at": "2020-01-05T18:58:50Z", + "browser_download_url": "https://github.com/gohugoio/hugo/releases/download/v0.62.2/hugo_0.62.2_OpenBSD-32bit.tar.gz" + }, + { + "url": "https://api.github.com/repos/gohugoio/hugo/releases/assets/17152871", + "id": 17152871, + "node_id": "MDEyOlJlbGVhc2VBc3NldDE3MTUyODcx", + "name": "hugo_0.62.2_OpenBSD-64bit.tar.gz", + "label": "", + "uploader": { + "login": "bep", + "id": 394382, + "node_id": "MDQ6VXNlcjM5NDM4Mg==", + "avatar_url": "https://avatars1.githubusercontent.com/u/394382?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bep", + "html_url": "https://github.com/bep", + "followers_url": "https://api.github.com/users/bep/followers", + "following_url": "https://api.github.com/users/bep/following{/other_user}", + "gists_url": "https://api.github.com/users/bep/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bep/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bep/subscriptions", + "organizations_url": "https://api.github.com/users/bep/orgs", + "repos_url": "https://api.github.com/users/bep/repos", + "events_url": "https://api.github.com/users/bep/events{/privacy}", + "received_events_url": "https://api.github.com/users/bep/received_events", + "type": "User", + "site_admin": false + }, + "content_type": "application/gzip", + "state": "uploaded", + "size": 13183077, + "download_count": 39, + "created_at": "2020-01-05T18:58:51Z", + "updated_at": "2020-01-05T18:58:52Z", + "browser_download_url": "https://github.com/gohugoio/hugo/releases/download/v0.62.2/hugo_0.62.2_OpenBSD-64bit.tar.gz" + }, + { + "url": "https://api.github.com/repos/gohugoio/hugo/releases/assets/17152864", + "id": 17152864, + "node_id": "MDEyOlJlbGVhc2VBc3NldDE3MTUyODY0", + "name": "hugo_0.62.2_OpenBSD-ARM.tar.gz", + "label": "", + "uploader": { + "login": "bep", + "id": 394382, + "node_id": "MDQ6VXNlcjM5NDM4Mg==", + "avatar_url": "https://avatars1.githubusercontent.com/u/394382?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bep", + "html_url": "https://github.com/bep", + "followers_url": "https://api.github.com/users/bep/followers", + "following_url": "https://api.github.com/users/bep/following{/other_user}", + "gists_url": "https://api.github.com/users/bep/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bep/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bep/subscriptions", + "organizations_url": "https://api.github.com/users/bep/orgs", + "repos_url": "https://api.github.com/users/bep/repos", + "events_url": "https://api.github.com/users/bep/events{/privacy}", + "received_events_url": "https://api.github.com/users/bep/received_events", + "type": "User", + "site_admin": false + }, + "content_type": "application/gzip", + "state": "uploaded", + "size": 12322903, + "download_count": 9, + "created_at": "2020-01-05T18:58:50Z", + "updated_at": "2020-01-05T18:58:50Z", + "browser_download_url": "https://github.com/gohugoio/hugo/releases/download/v0.62.2/hugo_0.62.2_OpenBSD-ARM.tar.gz" + }, + { + "url": "https://api.github.com/repos/gohugoio/hugo/releases/assets/17152862", + "id": 17152862, + "node_id": "MDEyOlJlbGVhc2VBc3NldDE3MTUyODYy", + "name": "hugo_0.62.2_Windows-32bit.zip", + "label": "", + "uploader": { + "login": "bep", + "id": 394382, + "node_id": "MDQ6VXNlcjM5NDM4Mg==", + "avatar_url": "https://avatars1.githubusercontent.com/u/394382?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bep", + "html_url": "https://github.com/bep", + "followers_url": "https://api.github.com/users/bep/followers", + "following_url": "https://api.github.com/users/bep/following{/other_user}", + "gists_url": "https://api.github.com/users/bep/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bep/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bep/subscriptions", + "organizations_url": "https://api.github.com/users/bep/orgs", + "repos_url": "https://api.github.com/users/bep/repos", + "events_url": "https://api.github.com/users/bep/events{/privacy}", + "received_events_url": "https://api.github.com/users/bep/received_events", + "type": "User", + "site_admin": false + }, + "content_type": "application/zip", + "state": "uploaded", + "size": 12221573, + "download_count": 154, + "created_at": "2020-01-05T18:58:49Z", + "updated_at": "2020-01-05T18:58:50Z", + "browser_download_url": "https://github.com/gohugoio/hugo/releases/download/v0.62.2/hugo_0.62.2_Windows-32bit.zip" + }, + { + "url": "https://api.github.com/repos/gohugoio/hugo/releases/assets/17152865", + "id": 17152865, + "node_id": "MDEyOlJlbGVhc2VBc3NldDE3MTUyODY1", + "name": "hugo_0.62.2_Windows-64bit.zip", + "label": "", + "uploader": { + "login": "bep", + "id": 394382, + "node_id": "MDQ6VXNlcjM5NDM4Mg==", + "avatar_url": "https://avatars1.githubusercontent.com/u/394382?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bep", + "html_url": "https://github.com/bep", + "followers_url": "https://api.github.com/users/bep/followers", + "following_url": "https://api.github.com/users/bep/following{/other_user}", + "gists_url": "https://api.github.com/users/bep/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bep/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bep/subscriptions", + "organizations_url": "https://api.github.com/users/bep/orgs", + "repos_url": "https://api.github.com/users/bep/repos", + "events_url": "https://api.github.com/users/bep/events{/privacy}", + "received_events_url": "https://api.github.com/users/bep/received_events", + "type": "User", + "site_admin": false + }, + "content_type": "application/zip", + "state": "uploaded", + "size": 13265631, + "download_count": 7902, + "created_at": "2020-01-05T18:58:50Z", + "updated_at": "2020-01-05T18:58:50Z", + "browser_download_url": "https://github.com/gohugoio/hugo/releases/download/v0.62.2/hugo_0.62.2_Windows-64bit.zip" + }, + { + "url": "https://api.github.com/repos/gohugoio/hugo/releases/assets/17152859", + "id": 17152859, + "node_id": "MDEyOlJlbGVhc2VBc3NldDE3MTUyODU5", + "name": "hugo_extended_0.62.2_Linux-64bit.deb", + "label": "", + "uploader": { + "login": "bep", + "id": 394382, + "node_id": "MDQ6VXNlcjM5NDM4Mg==", + "avatar_url": "https://avatars1.githubusercontent.com/u/394382?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bep", + "html_url": "https://github.com/bep", + "followers_url": "https://api.github.com/users/bep/followers", + "following_url": "https://api.github.com/users/bep/following{/other_user}", + "gists_url": "https://api.github.com/users/bep/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bep/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bep/subscriptions", + "organizations_url": "https://api.github.com/users/bep/orgs", + "repos_url": "https://api.github.com/users/bep/repos", + "events_url": "https://api.github.com/users/bep/events{/privacy}", + "received_events_url": "https://api.github.com/users/bep/received_events", + "type": "User", + "site_admin": false + }, + "content_type": "application/x-debian-package", + "state": "uploaded", + "size": 14137254, + "download_count": 855, + "created_at": "2020-01-05T18:58:49Z", + "updated_at": "2020-01-05T18:58:49Z", + "browser_download_url": "https://github.com/gohugoio/hugo/releases/download/v0.62.2/hugo_extended_0.62.2_Linux-64bit.deb" + }, + { + "url": "https://api.github.com/repos/gohugoio/hugo/releases/assets/17152844", + "id": 17152844, + "node_id": "MDEyOlJlbGVhc2VBc3NldDE3MTUyODQ0", + "name": "hugo_extended_0.62.2_Linux-64bit.tar.gz", + "label": "", + "uploader": { + "login": "bep", + "id": 394382, + "node_id": "MDQ6VXNlcjM5NDM4Mg==", + "avatar_url": "https://avatars1.githubusercontent.com/u/394382?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bep", + "html_url": "https://github.com/bep", + "followers_url": "https://api.github.com/users/bep/followers", + "following_url": "https://api.github.com/users/bep/following{/other_user}", + "gists_url": "https://api.github.com/users/bep/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bep/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bep/subscriptions", + "organizations_url": "https://api.github.com/users/bep/orgs", + "repos_url": "https://api.github.com/users/bep/repos", + "events_url": "https://api.github.com/users/bep/events{/privacy}", + "received_events_url": "https://api.github.com/users/bep/received_events", + "type": "User", + "site_admin": false + }, + "content_type": "application/gzip", + "state": "uploaded", + "size": 14145652, + "download_count": 5218, + "created_at": "2020-01-05T18:58:47Z", + "updated_at": "2020-01-05T18:58:47Z", + "browser_download_url": "https://github.com/gohugoio/hugo/releases/download/v0.62.2/hugo_extended_0.62.2_Linux-64bit.tar.gz" + }, + { + "url": "https://api.github.com/repos/gohugoio/hugo/releases/assets/17152852", + "id": 17152852, + "node_id": "MDEyOlJlbGVhc2VBc3NldDE3MTUyODUy", + "name": "hugo_extended_0.62.2_macOS-64bit.tar.gz", + "label": "", + "uploader": { + "login": "bep", + "id": 394382, + "node_id": "MDQ6VXNlcjM5NDM4Mg==", + "avatar_url": "https://avatars1.githubusercontent.com/u/394382?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bep", + "html_url": "https://github.com/bep", + "followers_url": "https://api.github.com/users/bep/followers", + "following_url": "https://api.github.com/users/bep/following{/other_user}", + "gists_url": "https://api.github.com/users/bep/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bep/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bep/subscriptions", + "organizations_url": "https://api.github.com/users/bep/orgs", + "repos_url": "https://api.github.com/users/bep/repos", + "events_url": "https://api.github.com/users/bep/events{/privacy}", + "received_events_url": "https://api.github.com/users/bep/received_events", + "type": "User", + "site_admin": false + }, + "content_type": "application/gzip", + "state": "uploaded", + "size": 14784660, + "download_count": 628, + "created_at": "2020-01-05T18:58:47Z", + "updated_at": "2020-01-05T18:58:48Z", + "browser_download_url": "https://github.com/gohugoio/hugo/releases/download/v0.62.2/hugo_extended_0.62.2_macOS-64bit.tar.gz" + }, + { + "url": "https://api.github.com/repos/gohugoio/hugo/releases/assets/17152853", + "id": 17152853, + "node_id": "MDEyOlJlbGVhc2VBc3NldDE3MTUyODUz", + "name": "hugo_extended_0.62.2_Windows-64bit.zip", + "label": "", + "uploader": { + "login": "bep", + "id": 394382, + "node_id": "MDQ6VXNlcjM5NDM4Mg==", + "avatar_url": "https://avatars1.githubusercontent.com/u/394382?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bep", + "html_url": "https://github.com/bep", + "followers_url": "https://api.github.com/users/bep/followers", + "following_url": "https://api.github.com/users/bep/following{/other_user}", + "gists_url": "https://api.github.com/users/bep/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bep/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bep/subscriptions", + "organizations_url": "https://api.github.com/users/bep/orgs", + "repos_url": "https://api.github.com/users/bep/repos", + "events_url": "https://api.github.com/users/bep/events{/privacy}", + "received_events_url": "https://api.github.com/users/bep/received_events", + "type": "User", + "site_admin": false + }, + "content_type": "application/zip", + "state": "uploaded", + "size": 30553922, + "download_count": 3681, + "created_at": "2020-01-05T18:58:48Z", + "updated_at": "2020-01-05T18:58:49Z", + "browser_download_url": "https://github.com/gohugoio/hugo/releases/download/v0.62.2/hugo_extended_0.62.2_Windows-64bit.zip" + } + ], + "tarball_url": "https://api.github.com/repos/gohugoio/hugo/tarball/v0.62.2", + "zipball_url": "https://api.github.com/repos/gohugoio/hugo/zipball/v0.62.2", + "body": "The main driving force behind these patch releases in the new year has been getting a good story with [portable links](https://github.com/bep/portable-hugo-links/) between GitHub and Hugo, using the new render hooks introduced in [Hugo 0.62.0](https://gohugo.io/news/0.62.0-relnotes/). And all was mostly well until a Hugo user asked about anchor links. Which is, when you look into it, a slightly sad Markdown story. They have been [talking about anchors in Markdown](https://talk.commonmark.org/t/anchors-in-markdown/247) over at the CommonMark forum for the last six years, but it has come to nothing. The current situation is that some Markdown engines support the `{#anchorName}` attribute syntax (Hugo's Goldmark does, GitHub does not) and for those that support auto-generation of IDs, the implementation often varies. And this makes for poor portability.\r\n\r\nTo improve this, Hugo has now reverse-engineered GitHub's implementation and made that the default strategy for generation or header IDs. We understand that this isn't everyone's cup of tea, so you can [configure the behaviour](https://gohugo.io/getting-started/configuration-markup#goldmark) to be one of `github`, `github-ascii` (some client-libraries have Unicode issues) or `blackfriday` (which will match how it behaved before Hugo 0.60).\r\n\r\n* hugolib: Fix relative .Page.GetPage from bundle [196a9df5](https://github.com/gohugoio/hugo/commit/196a9df585c4744e3280f37c1c24e469fce14b8c) [@bep](https://github.com/bep) [#6705](https://github.com/gohugoio/hugo/issues/6705)\r\n* markup/goldmark: Adjust auto ID space handling [9b6e6146](https://github.com/gohugoio/hugo/commit/9b6e61464b09ffe3423fb8d7c72bddb7a9ed5b98) [@bep](https://github.com/bep) [#6710](https://github.com/gohugoio/hugo/issues/6710)\r\n* docs: Document the new autoHeadingIDType setting [d62ede8e](https://github.com/gohugoio/hugo/commit/d62ede8e9e5883e7ebb023e49b82f07b45edc1c7) [@bep](https://github.com/bep) [#6707](https://github.com/gohugoio/hugo/issues/6707)[#6616](https://github.com/gohugoio/hugo/issues/6616)\r\n* docs: Regenerate docshelper [81b7e48a](https://github.com/gohugoio/hugo/commit/81b7e48a55092203aeee8785799e6fed3928760e) [@bep](https://github.com/bep) [#6707](https://github.com/gohugoio/hugo/issues/6707)[#6616](https://github.com/gohugoio/hugo/issues/6616)\r\n* markup/goldmark: Add an optional Blackfriday auto ID strategy [16e7c112](https://github.com/gohugoio/hugo/commit/16e7c1120346bd853cf6510ffac8e94824bf2c7f) [@bep](https://github.com/bep) [#6707](https://github.com/gohugoio/hugo/issues/6707)\r\n* markup/goldmark: Make the autoID type config a string [8f071fc1](https://github.com/gohugoio/hugo/commit/8f071fc159ce9a0fc0ea14a73bde8f299bedd109) [@bep](https://github.com/bep) [#6707](https://github.com/gohugoio/hugo/issues/6707)\r\n* markup/goldmark: Simplify code [5ee1f087](https://github.com/gohugoio/hugo/commit/5ee1f0876f3ec8b79d6305298185dc821ead2d28) [@bep](https://github.com/bep) \r\n* markup/goldmark: Make auto IDs GitHub compatible [a82d2700](https://github.com/gohugoio/hugo/commit/a82d2700fcc772aada15d65b8f76913ca23f7404) [@bep](https://github.com/bep) [#6616](https://github.com/gohugoio/hugo/issues/6616)\r\n\r\n\r\n\r\n\r\n" +} diff --git a/__tests__/main.test.ts b/__tests__/main.test.ts new file mode 100644 index 0000000..c8f8d8f --- /dev/null +++ b/__tests__/main.test.ts @@ -0,0 +1,62 @@ +import * as main from '../src/main'; +import * as io from '@actions/io'; +import path from 'path'; +import nock from 'nock'; +// import {FetchError} from 'node-fetch'; +import jsonTestBrew from './data/brew.json'; +// import jsonTestGithub from './data/github.json'; + +jest.setTimeout(30000); +const repo = 'hugo'; + +beforeEach(() => { + jest.resetModules(); +}); + +afterEach(() => { + delete process.env['INPUT_HUGO-VERSION']; + nock.cleanAll(); +}); + +describe('Integration testing run()', () => { + afterEach(async () => { + await io.rmRF(path.join(`${process.env.HOME}`, 'tmp')); + }); + + test('succeed in installing a custom version', async () => { + const testVersion = '0.61.0'; + process.env['INPUT_HUGO-VERSION'] = testVersion; + const result: main.ActionResult = await main.run(); + expect(result.exitcode).toBe(0); + expect(result.output).toMatch(`Hugo Static Site Generator v${testVersion}`); + }); + + test('succeed in installing the latest version', async () => { + const testVersion = 'latest'; + process.env['INPUT_HUGO-VERSION'] = testVersion; + nock('https://formulae.brew.sh') + .get(`/api/formula/${repo}.json`) + .reply(200, jsonTestBrew); + const result: main.ActionResult = await main.run(); + expect(result.exitcode).toBe(0); + expect(result.output).toMatch('Hugo Static Site Generator v0.62.2'); + }); +}); + +describe('showVersion()', () => { + let result: main.ActionResult = { + exitcode: 0, + output: '' + }; + + test('return version', async () => { + result = await main.showVersion('git', ['--version']); + expect(result.exitcode).toBe(0); + expect(result.output).toMatch(/git version/); + }); + + test('return not found', async () => { + result = await main.showVersion('gitgit', ['--version']); + expect(result.exitcode).not.toBe(0); + }); +}); diff --git a/package-lock.json b/package-lock.json index 35b4456..5a227ec 100644 --- a/package-lock.json +++ b/package-lock.json @@ -630,6 +630,27 @@ "integrity": "sha512-gCubfBUZ6KxzoibJ+SCUc/57Ms1jz5NjHe4+dI2krNmU5zCPAphyLJYyTOg06ueIyfj+SaCUqmzun7ImlxDcKg==", "dev": true }, + "@typescript-eslint/eslint-plugin": { + "version": "2.16.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.16.0.tgz", + "integrity": "sha512-TKWbeFAKRPrvKiR9GNxErQ8sELKqg1ZvXi6uho07mcKShBnCnqNpDQWP01FEvWKf0bxM2g7uQEI5MNjSNqvUpQ==", + "dev": true, + "requires": { + "@typescript-eslint/experimental-utils": "2.16.0", + "eslint-utils": "^1.4.3", + "functional-red-black-tree": "^1.0.1", + "regexpp": "^3.0.0", + "tsutils": "^3.17.1" + }, + "dependencies": { + "regexpp": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.0.0.tgz", + "integrity": "sha512-Z+hNr7RAVWxznLPuA7DIh8UNX1j9CDrUQxskw9IrBE1Dxue2lyXT+shqEIeLUjrokxIP8CMy1WkjgG3rTsd5/g==", + "dev": true + } + } + }, "@typescript-eslint/experimental-utils": { "version": "2.16.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.16.0.tgz", @@ -2337,6 +2358,61 @@ } } }, + "eslint-plugin-jest": { + "version": "23.6.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-23.6.0.tgz", + "integrity": "sha512-GH8AhcFXspOLqak7fqnddLXEJsrFyvgO8Bm60SexvKSn1+3rWYESnCiWUOCUcBTprNSDSE4CtAZdM4EyV6gPPw==", + "dev": true, + "requires": { + "@typescript-eslint/experimental-utils": "^2.5.0", + "micromatch": "^4.0.2" + }, + "dependencies": { + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "micromatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", + "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", + "dev": true, + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.0.5" + } + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + } + } + }, "eslint-scope": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.0.0.tgz", @@ -6225,6 +6301,36 @@ "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", "dev": true }, + "nock": { + "version": "11.7.2", + "resolved": "https://registry.npmjs.org/nock/-/nock-11.7.2.tgz", + "integrity": "sha512-7swr5bL1xBZ5FctyubjxEVySXOSebyqcL7Vy1bx1nS9IUqQWj81cmKjVKJLr8fHhtzI1MV8nyCdENA/cGcY1+Q==", + "dev": true, + "requires": { + "debug": "^4.1.0", + "json-stringify-safe": "^5.0.1", + "lodash": "^4.17.13", + "mkdirp": "^0.5.0", + "propagate": "^2.0.0" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, "node-fetch": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz", @@ -6698,6 +6804,12 @@ "sisteransi": "^1.0.3" } }, + "propagate": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/propagate/-/propagate-2.0.1.tgz", + "integrity": "sha512-vGrhOavPSTz4QVNuBNdcNXePNdNMaO1xj9yBeH1ScQPjk/rhg9sSlCXPhMkFuaNNW/syTvYqsnbIJxMBfRbbag==", + "dev": true + }, "psl": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.4.0.tgz", diff --git a/package.json b/package.json index b086600..390eea4 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,8 @@ "description": "Hugo setup action", "main": "lib/index.js", "scripts": { - "lint": "eslint ./src/**/*.ts", - "lint:fix": "eslint --fix ./src/**/*.ts", + "lint": "eslint ./{src,__tests__}/**/*.ts", + "lint:fix": "eslint --fix ./{src,__tests__}/**/*.ts", "test": "jest --coverage --verbose", "build": "ncc build ./src/index.ts -o lib", "tsc": "tsc", @@ -58,13 +58,16 @@ "@types/jest": "^24.9.0", "@types/node": "^13.1.7", "@types/node-fetch": "^2.5.4", + "@typescript-eslint/eslint-plugin": "^2.16.0", "@typescript-eslint/parser": "^2.16.0", "@zeit/ncc": "^0.21.0", "eslint": "^6.8.0", + "eslint-plugin-jest": "^23.6.0", "husky": "^4.0.10", "jest": "^24.9.0", "jest-circus": "^24.9.0", "lint-staged": "^9.5.0", + "nock": "^11.7.2", "prettier": "1.19.1", "standard-version": "^7.0.1", "ts-jest": "^24.3.0", diff --git a/src/constants.ts b/src/constants.ts new file mode 100644 index 0000000..e305ca4 --- /dev/null +++ b/src/constants.ts @@ -0,0 +1,7 @@ +export enum Tool { + Name = 'Hugo', + Org = 'gohugoio', + Repo = 'hugo', + CmdName = 'hugo', + CmdOptVersion = 'version' +} diff --git a/src/get-latest-version.ts b/src/get-latest-version.ts index f0031a3..e6f3c37 100644 --- a/src/get-latest-version.ts +++ b/src/get-latest-version.ts @@ -1,7 +1,7 @@ import fetch from 'node-fetch'; export function getURL(org: string, repo: string, api: string): string { - let url: string = ''; + let url = ''; if (api === 'brew') { url = `https://formulae.brew.sh/api/formula/${repo}.json`; @@ -21,7 +21,7 @@ export async function getLatestVersion( const url = getURL(org, repo, api); const response = await fetch(url); const json = await response.json(); - let latestVersion: string = ''; + let latestVersion = ''; if (api === 'brew') { latestVersion = json.versions.stable; } else if (api === 'github') { diff --git a/src/get-os.ts b/src/get-os.ts index b94917a..38a2eba 100644 --- a/src/get-os.ts +++ b/src/get-os.ts @@ -1,4 +1,4 @@ -export default function getOS(platform: string) { +export default function getOS(platform: string): string { if (platform === 'linux') { return 'Linux'; } else if (platform === 'darwin') { diff --git a/src/get-url.ts b/src/get-url.ts index 42bd9af..ea9726c 100644 --- a/src/get-url.ts +++ b/src/get-url.ts @@ -3,7 +3,7 @@ export default function getURL( extended: string, version: string ): string { - const extendedStr = (extended: string) => { + const extendedStr = (extended: string): string => { if (extended === 'true') { return 'extended_'; } else { @@ -13,7 +13,7 @@ export default function getURL( } }; - const ext = (os: string) => { + const ext = (os: string): string => { if (os === 'Windows') { return 'zip'; } else { @@ -21,11 +21,9 @@ export default function getURL( } }; - const hugoName: string = `hugo_${extendedStr( - extended - )}${version}_${os}-64bit`; - const baseURL: string = 'https://github.com/gohugoio/hugo/releases/download'; - const url: string = `${baseURL}/v${version}/${hugoName}.${ext(os)}`; + const hugoName = `hugo_${extendedStr(extended)}${version}_${os}-64bit`; + const baseURL = 'https://github.com/gohugoio/hugo/releases/download'; + const url = `${baseURL}/v${version}/${hugoName}.${ext(os)}`; return url; } diff --git a/src/index.ts b/src/index.ts index a7224c2..c14e8f1 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,67 +1,3 @@ -import * as core from '@actions/core'; -import * as exec from '@actions/exec'; -import {getLatestVersion} from './get-latest-version'; -import {installer} from './installer'; +import * as main from './main'; -export interface actionResult { - exitcode: number; - output: string; -} - -export async function showVersion( - cmd: string, - args: string[] -): Promise { - try { - let result: actionResult = { - exitcode: 0, - output: '' - }; - - const options = { - listeners: { - stdout: (data: Buffer) => { - result.output += data.toString(); - } - } - }; - - result.exitcode = await exec.exec(cmd, args, options); - core.debug(` - exit code: ${result.exitcode} - stdout: ${result.output} - `); - return result; - } catch (e) { - return e; - } -} - -async function run() { - try { - const toolVersion: string = core.getInput('hugo-version'); - let installVersion: string = ''; - - let result: actionResult = { - exitcode: 0, - output: '' - }; - - if (toolVersion === '' || toolVersion === 'latest') { - installVersion = await getLatestVersion('gohugoio', 'hugo', 'brew'); - } else { - installVersion = toolVersion; - } - - core.info(`hugo version: ${installVersion}`); - await installer(installVersion); - result = await showVersion('hugo', ['version']); - - return result; - } catch (e) { - core.setFailed(`Action failed with error ${e}`); - return e; - } -} - -run(); +main.run(); diff --git a/src/installer.ts b/src/installer.ts index 5ce0f37..fb9179e 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -16,7 +16,7 @@ if (!tempDir) { tempDir = path.join(baseTempLocation, 'tmp'); } -export async function installer(version: string) { +export async function installer(version: string): Promise { try { const extended: string = core.getInput('extended'); console.log(`Hugo extended: ${extended}`); @@ -40,7 +40,7 @@ export async function installer(version: string) { // Download and extract Hugo binary await io.mkdirP(tempDir); const hugoAssets: string = await tc.downloadTool(hugoURL); - let hugoBin: string = ''; + let hugoBin = ''; if (osName === 'Windows') { const hugoExtractedFolder: string = await tc.extractZip( hugoAssets, diff --git a/src/main.ts b/src/main.ts new file mode 100644 index 0000000..20dd72d --- /dev/null +++ b/src/main.ts @@ -0,0 +1,65 @@ +import * as core from '@actions/core'; +import * as exec from '@actions/exec'; +import {getLatestVersion} from './get-latest-version'; +import {installer} from './installer'; +import {Tool} from './constants'; + +export interface ActionResult { + exitcode: number; + output: string; +} + +export async function showVersion( + cmd: string, + args: string[] +): Promise { + const result: ActionResult = { + exitcode: 0, + output: '' + }; + + const options = { + listeners: { + stdout: (data: Buffer): void => { + result.output += data.toString(); + } + } + }; + + try { + result.exitcode = await exec.exec(cmd, args, options); + } catch (e) { + return e; + } + core.debug(`command: ${cmd} ${args}`); + core.debug(`exit code: ${result.exitcode}`); + core.debug(`stdout: ${result.output}`); + return result; +} + +export async function run(): Promise { + try { + const toolVersion: string = core.getInput('hugo-version'); + let installVersion = ''; + + let result: ActionResult = { + exitcode: 0, + output: '' + }; + + if (toolVersion === '' || toolVersion === 'latest') { + installVersion = await getLatestVersion(Tool.Org, Tool.Repo, 'brew'); + } else { + installVersion = toolVersion; + } + + core.info(`${Tool.Name} version: ${installVersion}`); + await installer(installVersion); + result = await showVersion(Tool.CmdName, [Tool.CmdOptVersion]); + + return result; + } catch (e) { + core.setFailed(`Action failed with error ${e}`); + return e; + } +} diff --git a/tsconfig.json b/tsconfig.json index bc71c16..0363e85 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -45,7 +45,7 @@ // "typeRoots": [], /* List of folders to include type definitions from. */ // "types": [], /* Type declaration files to be included in compilation. */ // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ - "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ + "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ @@ -58,6 +58,8 @@ /* Experimental Options */ // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ + + "resolveJsonModule": true }, "exclude": ["node_modules", "**/*.test.ts"] }