diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 543213c..c369e8a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 @@ -24,10 +21,10 @@ 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 @@ -35,10 +32,3 @@ jobs: - 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 }} diff --git a/.github/workflows/release-package.yml b/.github/workflows/release-package.yml new file mode 100644 index 0000000..d989968 --- /dev/null +++ b/.github/workflows/release-package.yml @@ -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}} \ No newline at end of file diff --git a/package.json b/package.json index 66a2677..eaf725f 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,9 @@ "files": [ "lib/**/*" ], + "publishConfig": { + "IvanRave:registry": "https://npm.pkg.github.com" + }, "scripts": { "build": "tsc", "test": "jest",