Skip to content

Commit

Permalink
Add scripts (#3)
Browse files Browse the repository at this point in the history
* Add NPM Upload GitHub action

- Add release scripts
- Update dependabot to check GitHub actions
  • Loading branch information
rogebrd authored Oct 16, 2020
1 parent 407e7e0 commit a4bcac4
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: "\U0001F41B Bug report"
name: ':bug: Bug report'
about: Create a report to help us improve the SDK
title: ''
labels: bug
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: "\U0001F680 Feature Request"
name: ':rocket: Feature Request'
about: Suggest an idea for this SDK
title: ''
labels: enhancement
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/question_help.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: "\U0001F4AC Questions / Help"
name: ':speech_balloon: Questions / Help'
about: Get help with issues you are experiencing
title: ''
labels: help-wanted, question
Expand Down
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
24 changes: 24 additions & 0 deletions .github/workflows/npm_upload.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Publish to NPM

on:
release:
types: [created]

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: ':bellhop_bell: Checkout Package'
uses: actions/checkout@v2
- name: ':gear: Setup Node.JS'
uses: actions/setup-node@v2.1.2
with:
node-version: 14
- name: ':building_construction: Build Package'
run: |
npm install
npm run build
- name: ':rocket: Publish to NPM'
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
9 changes: 9 additions & 0 deletions scripts/release_note_generator.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

last_version=$(git tag --sort v:refname | tail -n 2 | head -n 1)
echo "Getting commit history since $last_version"
num_commits=$(git rev-list --count $last_version..HEAD)
echo "Found $num_commits commits since last revision"
git_log=$(git log -n $num_commits --pretty="format:* %s %n")
linked_log=$(echo "Release Notes: \n\n$git_log" | sed -e 's/#\([0-9]*\)/[#\1](https:\/\/github.com\/rogebrd\/dropbox-oauth-popup\/pull\/\1)/g')
echo "\n\n$linked_log"
17 changes: 17 additions & 0 deletions scripts/update_version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh

if [ -z $1 ]; then
echo "error: $0 needs a version number as argument.";
exit 1
else
set -ex
NEW_VERSION=$1

git checkout master
git reset --hard HEAD

git tag "v${NEW_VERSION}" -m "${NEW_VERSION} release"

git push origin
git push origin --tags
fi

0 comments on commit a4bcac4

Please sign in to comment.