Skip to content

Commit

Permalink
chore(workflow): release
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanRave committed Sep 30, 2021
1 parent 8413f5f commit 22fce22
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 16 deletions.
22 changes: 6 additions & 16 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
# This is a basic workflow to help you get started with Actions
name: CI Code Quality Workflow

name: CI

# Controls when the workflow will run
on:
push:
branches: [ master ]
# pull_request:
# branches: [ master ]
pull_request:
branches: [ master ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
publishgpr:
validate:
# The type of runner that the job will run on
runs-on: ubuntu-latest

Expand All @@ -24,21 +21,14 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
node-version: 14
- run: npm install

- name: Validate TS
- name: Lint TS
run: npm run lint

- name: Test TS
run: npm test

- name: TS to JS
run: npm run build

- uses: actions/setup-node@v2
with:
registry-url: 'https://npm.pkg.github.com'
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35 changes: 35 additions & 0 deletions .github/workflows/release-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: CI Release workflow

on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 14
- run: npm ci
- run: npm lint
- run: npm test
- run: npm build

publish-gpr:
needs: build
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 14
registry-url: https://npm.pkg.github.com/
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
"files": [
"lib/**/*"
],
"publishConfig": {
"IvanRave:registry": "https://npm.pkg.github.com"
},
"scripts": {
"build": "tsc",
"test": "jest",
Expand Down

0 comments on commit 22fce22

Please sign in to comment.