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

Convert from travis to GitHub actions #284

Merged
merged 7 commits into from
May 13, 2024
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
2 changes: 2 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ updates:
assignees:
- jsnoble
- godber
- busma13
- sotojn
ignore:
- dependency-name: '@types/node'
versions:
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Build and Publish

on:
pull_request:
branches:
- master
types:
- closed

jobs:
npm-publish:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
# NOTE: Hard Coded Node Version
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
- run: yarn setup
- name: Retrieve version
run : echo "NEW_VERSION=$(jq -r '.version' package.json)" >> $GITHUB_OUTPUT
id: version
- run: yarn publish --new-version ${{ steps.version.outputs.NEW_VERSION }} --access public --non-interactive
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
48 changes: 48 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Fetch-Github-Release Tests
on:
pull_request:
branches: [ master ]

jobs:
verify-build:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18.x
cache: 'yarn'

- name: Install and build packages
run: yarn setup
env:
YARN_SETUP_ARGS: "--prod=false --silent"

- name: Lint codebase
run: yarn lint

run-tests:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x, 22.x]
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Setup Node ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'

- name: Install and build packages
run: yarn setup
env:
YARN_SETUP_ARGS: "--prod=false --silent"

- name: Test
run: yarn --silent test
29 changes: 0 additions & 29 deletions .travis.yml

This file was deleted.

4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
A node module to download Github release assets. It will also uncompress zip
files and skip downloading if a file already exists.

[![Build Status](https://travis-ci.org/terascope/fetch-github-release.svg?branch=master)](https://travis-ci.org/terascope/fetch-github-release)
[![codecov](https://codecov.io/gh/terascope/fetch-github-release/branch/master/graph/badge.svg)](https://codecov.io/gh/terascope/fetch-github-release)
[![Build Status](https://david-dm.org/terascope/fetch-github-release.svg)](https://david-dm.org/terascope/fetch-github-release)

```
$ fetch-github-release -s darwin-x64 electron electron
Downloading electron/[email protected]...
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"publishConfig": {
"access": "public"
},
"version": "0.8.7",
"version": "0.8.8",
"description": "Download a specific release from github",
"files": [
"dist/src/**/*",
Expand Down
22 changes: 14 additions & 8 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,17 @@ function filterAsset(asset: GithubReleaseAsset): boolean {
return new RegExp(command.search).test(asset.name);
}

downloadRelease(user as string, repo as string, outputdir as string, filterRelease, filterAsset,
!!command.zipped, !!command.quiet)
.catch((err) => {
console.error(err);
process.exitCode = 1;
}).finally(() => {
process.exit();
});
downloadRelease(
user as string,
repo as string,
outputdir as string,
filterRelease,
filterAsset,
!!command.zipped,
!!command.quiet
).catch((err) => {
console.error(err);
process.exitCode = 1;
}).finally(() => {
process.exit();
});