Skip to content

Commit

Permalink
feat: release
Browse files Browse the repository at this point in the history
  • Loading branch information
martinstark committed Feb 18, 2021
1 parent e7954d1 commit 821319f
Show file tree
Hide file tree
Showing 6 changed files with 100 additions and 3 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Release the packages

name: Release

on:
workflow_dispatch:

jobs:
release:
if: "!contains(github.event.head_commit.message, 'skip ci')"
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
# install
- name: install
run: yarn
# do releases
- name: semantic-release
run: yarn semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32 changes: 32 additions & 0 deletions .github/workflows/run-prettier.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Prettier Check
on: [pull_request]

jobs:
prettier:
if: "!contains(github.event.pull_request.title, 'WIP!')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Cache node_modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.cache/yarn
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '14.x'
registry-url: 'https://npm.pkg.github.com/'

- name: Install Dependencies
run: yarn --frozen-lockfile --ignore-platform

- name: Run Prettier
run: yarn prettier --check .
34 changes: 34 additions & 0 deletions .github/workflows/run-typescript.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Transpile and Build Check
on: [pull_request]

jobs:
builds:
if: "!contains(github.event.pull_request.title, 'WIP!')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Cache node_modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.cache/yarn
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '14.x'
registry-url: 'https://npm.pkg.github.com/'

- name: Install Dependencies
run: yarn --frozen-lockfile --ignore-platform

- name: Run Build Command
run: |
yarn
yarn build
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@martinstark:registry=https://npm.pkg.github.com/
3 changes: 2 additions & 1 deletion .releaserc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"branches": ["master"],
"branches": ["main"],
"repositoryUrl": "https://github.com/martinstark/throttle-ts",
"debug": "true",
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
Expand Down
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
{
"name": "throttle-ts",
"name": "@martinstark/throttle-ts",
"version": "0.0.0",
"description": "Correctly typed generic throttle function",
"typings": "dist/typings/index.d.ts",
"main": "dist/throttle-ts.min.js",
"private": false,
"files": [
"/dist",
"package.json",
"CHANGELOG.md"
],
"repository": {
"type": "git",
"url": "git@github.com:martinstark/throttle-ts.git"
Expand All @@ -15,7 +20,8 @@
"fix": "eslint --fix .",
"lintstaged": "lint-staged",
"pretty": "prettier --write .",
"ts": "tsc --noEmit"
"ts": "tsc --noEmit",
"prepublishOnly": "yarn build"
},
"devDependencies": {
"@babel/core": "7.12.9",
Expand Down

0 comments on commit 821319f

Please sign in to comment.