Skip to content

Commit

Permalink
GitHub Actions NPM Release (#5)
Browse files Browse the repository at this point in the history
* Remove travis

* Fix tiny syntax bug

* Add org to name in package.json

* Add templates for PRs and issues

* Add GitHub Actions for testing and publishing

* Linting not yet implemented

* Commit the package-lock file for consistent builds
  • Loading branch information
wilwade authored May 6, 2021
1 parent 5d03d1b commit 5547ad4
Show file tree
Hide file tree
Showing 11 changed files with 6,141 additions and 18 deletions.
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/BUG_Issue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Bug Report
about: Report an issue found in @unfinishedlabs/parquetjs
title: ""
labels: ""
assignees: ""
---
Thanks for reporting an issue!

### Steps to reproduce
Tell us how to reproduce this issue.

### Expected behaviour
Tell us what should happen

### Actual behaviour
Tell us what happens instead

### Any logs, error output, etc?
...

### Any other comments?
...
4 changes: 4 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
blank_issues_enabled: true
contact_links:
- name: Issue Template

22 changes: 22 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Problem
=======
problem statement
Solution
========
What I/we did to solve this problem

with @pairperson1

Change summary:
---------------
* Tidy, well formulated commit message
* Another great commit message
* Something else I/we did

Steps to Verify:
----------------
1. A setup step / beginning state
1. What to do next
1. Any other instructions
1. Expected behavior
1. Suggestions for testing
36 changes: 36 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Tests CI
on:
push:
branches: [ main ]
pull_request:
branches: [ '**' ]
jobs:
test:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '14.16.0'

- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install 💾
run: npm ci

- name: Lint
run: npm run lint

- name: Test
run: npm run test

- name: Build & Publish Dry Run
run: npm publish --dry-run
36 changes: 36 additions & 0 deletions .github/workflows/publish-next.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Publish NPM @next
on:
push:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '14.16.0'
registry-url: 'https://registry.npmjs.org'

- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install 💾
run: npm ci

- name: Version ⬆️
run: npm version --new-version "v0.0.0-${FULL_SHA:0:6}" --no-git-tag-version
env:
FULL_SHA: ${{ github.sha }}

- name: Publish @next 🚂
run: npm publish --tag next --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}}
34 changes: 34 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Release Package
on:
release:
types: [ released ]
jobs:
publish-to-npm:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '14.16.0'
registry-url: 'https://registry.npmjs.org'

- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install 💾
run: npm ci

- name: Version ⬆️
run: npm version --new-version ${{ github.event.release.tag_name }} --no-git-tag-version

- name: Publish 🚂
run: npm publish --tag latest
env:
NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
node_modules
*.parquet
npm-debug.log
package-lock.json
.nyc_output
dist
!test/test-files/*.parquet
11 changes: 0 additions & 11 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion lib/writer.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ class ParquetEnvelopeWriter {

constructor(schema, writeFn, closeFn, fileOffset, opts) {
this.schema = schema;
this.write = writeFn,
this.write = writeFn;
this.close = closeFn;
this.offset = fileOffset;
this.rowCount = 0;
Expand Down
Loading

0 comments on commit 5547ad4

Please sign in to comment.