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

Workflow and README.md tweaks #44

Merged
merged 4 commits into from
May 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
name: Publish
jpogran marked this conversation as resolved.
Show resolved Hide resolved

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
- run: npm install
- uses: JS-DevTools/npm-publish@v1
node-version-file: .nvmrc
- name: npm install
run: npm ci
- name: Publish package
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
node-version-file: .nvmrc
- name: npm install
run: npm ci
- name: test
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
out/
node_modules/
/out/
/node_modules/
jpogran marked this conversation as resolved.
Show resolved Hide resolved
.DS_Store
npm-debug.log
31 changes: 19 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
# js-releases

[![Run tests](https://github.com/hashicorp/js-releases/actions/workflows/test.yml/badge.svg)](https://github.com/hashicorp/js-releases/actions/workflows/test.yml)
[![Publish](https://github.com/hashicorp/js-releases/actions/workflows/publish.yml/badge.svg)](https://github.com/hashicorp/js-releases/actions/workflows/publish.yml)

## Download packages from releases.hashicorp.com

js-releases is a handy tool for downloading and verifying packages from releases.hashicorp.com. You can:
- fetch metadata for a given release (or latest)
- download the package
- verify the SHASUM and signature
- unpack to a specified directory
`js-releases` is a handy tool for downloading and verifying packages from [releases.hashicorp.com](https://releases.hashicorp.com/).

You can:

- fetch metadata for a given release (or latest)
- download the package
- verify the SHASUM and signature
- unpack to a specified directory

## Environment variables

The downloader can be configured with environment variables.
Current available vars:

| Parameter | Description | Default |
| --------------------------- | -------------------------------------------------------- | ------- |
| `HTTP_PROXY`/`http_proxy` | If configured will set the HTTP_PROXY to download with. | - |
| `HTTPS_PROXY`/`https_proxy` | If configured will set the HTTPS_PROXY to download with. | - |
Currently available variables:

| Environment variable | Description | Default |
jpogran marked this conversation as resolved.
Show resolved Hide resolved
|:-------------------------------|:---------------------------------------------------------------|:--------|
| `HTTP_PROXY` \| `http_proxy` | If configured will set the HTTP proxy to fetch/download with. | - |
| `HTTPS_PROXY` \| `https_proxy` | If configured will set the HTTPS proxy to fetch/download with. | - |

## Usage

```
```js
jpogran marked this conversation as resolved.
Show resolved Hide resolved
import { Release, getRelease } from '@hashicorp/js-releases';

// Setting a user agent string is optional but helpful!
Expand Down Expand Up @@ -50,7 +57,7 @@ return release.unpack(installPath, destination)

## Validating releases

Packages are verified using HashiCorp's public GPG key `72D7468F`. The previous key was rotated and revoked per [HCSEC-2021-12](https://discuss.hashicorp.com/t/hcsec-2021-12-codecov-security-event-and-hashicorp-gpg-key-exposure/23512) on 4/22/21. As a result, earlier versions of `js-releases` will no longer be able to verify packages.
Packages are verified using HashiCorp's public GPG key `72D7468F`. The previous key was rotated and revoked per [HCSEC-2021-12](https://discuss.hashicorp.com/t/hcsec-2021-12-codecov-security-event-and-hashicorp-gpg-key-exposure/23512) on 2021-04-22. As a result, earlier versions of `js-releases` will no longer be able to verify packages.
jpogran marked this conversation as resolved.
Show resolved Hide resolved

## License

Expand Down