Skip to content

Commit a1182d4

Browse files
authored
chore: init github actions (#1)
1 parent ff2da85 commit a1182d4

File tree

4 files changed

+98
-14
lines changed

4 files changed

+98
-14
lines changed

.github/workflows/ci.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: CI
2+
3+
on:
4+
- push
5+
- pull_request
6+
7+
jobs:
8+
test:
9+
name: Test for Node.js ${{ matrix.node-version }}
10+
runs-on: ubuntu-latest
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
node-version:
15+
- '18'
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v3
19+
- name: Setup Node
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: ${{ matrix.node-version }}
23+
- run: npm ci
24+
- run: npm test

.github/workflows/release.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v[0-9]+.[0-9]+.[0-9]+"
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v3
14+
- name: Setup Node
15+
uses: actions/setup-node@v3
16+
with:
17+
node-version: 18
18+
registry-url: "https://registry.npmjs.org"
19+
- run: npm ci
20+
- run: npm test
21+
- run: npm publish
22+
env:
23+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
24+
25+
release-note:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Checkout code
29+
uses: actions/checkout@v3
30+
with:
31+
fetch-depth: 0
32+
- name: Get the version
33+
id: get_version
34+
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
35+
- name: Get commit summary
36+
id: get_commit_summary
37+
run: |
38+
PREVIOUS_TAG=$(git tag --sort=-creatordate | sed -n 2p)
39+
echo "PREVIOUS_TAG: $PREVIOUS_TAG"
40+
COMMIT_SUMMARY="$(git log --oneline --pretty=tformat:"%h %s" $PREVIOUS_TAG..${{ github.ref }})"
41+
COMMIT_SUMMARY="${COMMIT_SUMMARY//$'\n'/'%0A'}"
42+
echo ::set-output name=COMMIT_SUMMARY::$COMMIT_SUMMARY
43+
- name: Create Release
44+
uses: actions/create-release@v1
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
with:
48+
tag_name: ${{ steps.get_version.outputs.VERSION }}
49+
release_name: Release ${{ steps.get_version.outputs.VERSION }}
50+
body: |
51+
${{ steps.get_commit_summary.outputs.COMMIT_SUMMARY }}
52+
draft: true
53+
prerelease: false

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# Athena Query
1+
# Athena-Query
22

3-
**Athena Query** provide simple interface to get athena query results.
3+
**Athena-Query** provide simple interface to get athena query results.
44

5-
Athena Query wad inspired and forked from [athena-express](https://github.com/ghdna/athena-express#readme).
5+
Athena-Query wad inspired and forked from [athena-express](https://github.com/ghdna/athena-express#readme).
66

77
> **Warning**
8-
> Athena Query support aws-sdk v3 only. So if you use aws-sdk v2, we recommend to use [athena-express](https://github.com/ghdna/athena-express#readme).
8+
> Athena-Query support aws-sdk v3 only. So if you use aws-sdk v2, we recommend to use [athena-express](https://github.com/ghdna/athena-express#readme).
99
1010
## Installation
1111

@@ -19,7 +19,7 @@ yarn add athena-query @aws-sdk/client-athena
1919

2020
## Usage
2121

22-
Athena Query provide [async generator function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function*).
22+
Athena-Query provide [async generator function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function*).
2323
So we can use it with `for await () {}`,
2424

2525
```ts

package.json

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,33 @@
11
{
2-
"name": "athena-query",
2+
"name": "@classmethod/athena-query",
33
"version": "0.1.0",
4-
"description": "",
4+
"description": "Athena-Query makes it easier to execute SQL queries on Amazon Athena by consolidating & abstracting several methods in the AWS SDK",
55
"main": "./lib/index.js",
66
"types": "./lib/index.ts",
7-
"scripts": {
8-
"build": "tsc",
9-
"pretest": "npm run build",
10-
"test": "jest"
7+
"author": "Classmethod, Inc.",
8+
"license": "MIT",
9+
"repository": {
10+
"type": "git",
11+
"url": "git+https://github.com/classmethod/athena-query.git"
12+
},
13+
"bugs": {
14+
"url": "https://github.com/classmethod/athena-query/issues"
1115
},
16+
"homepage": "https://github.com/classmethod/athena-query#readme",
1217
"keywords": [
1318
"aws",
1419
"athena",
1520
"amazon",
16-
"amazon",
1721
"web",
1822
"services",
1923
"sql",
2024
"database"
2125
],
22-
"author": "",
23-
"license": "MIT",
26+
"scripts": {
27+
"build": "tsc",
28+
"pretest": "npm run build",
29+
"test": "jest"
30+
},
2431
"devDependencies": {
2532
"@aws-sdk/client-athena": "^3.218.0",
2633
"@types/jest": "^29.2.3",

0 commit comments

Comments
 (0)