Skip to content
This repository has been archived by the owner on Aug 12, 2022. It is now read-only.

Commit

Permalink
ci: clean workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Burry committed Jan 24, 2022
1 parent d2fb30f commit 7ab5424
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 47 deletions.
1 change: 0 additions & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches: [master]
pull_request:
# The branches below must be a subset of the branches above
branches: [master]
schedule:
- cron: '17 23 * * 5'
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/fossa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: FOSSA scan

on: push

jobs:
fossa-scan:
name: FOSSA scan

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: FOSSA scan
uses: fossas/fossa-action@main
with:
api-key: ${{ secrets.FOSSA_API_KEY }}
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
name: Lint, build, scan, and release
name: Test, build, and release

on:
push:
branches:
- master

jobs:
lint:
name: Lint
test:
name: Test

runs-on: ubuntu-latest

steps:
- name: Preserve line endings
run: git config --global core.autocrlf false

- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup Node.js 14
uses: actions/setup-node@v2
Expand All @@ -45,28 +40,41 @@ jobs:
env:
CI: true

fossa-scan:
name: FOSSA scan
build:
name: Build

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: FOSSA scan
uses: fossas/fossa-action@main
- name: Setup Node.js 14
uses: actions/setup-node@v2
with:
api-key: ${{ secrets.FOSSA_API_KEY }}
node-version: 14

build-release:
name: Build and release
- name: Install dependencies
run: npm ci
env:
CI: true

needs: [lint, fossa-scan]
- name: Build
run: npm run build
env:
CI: true

release:
name: Release

needs: [test, build]

runs-on: ubuntu-latest

steps:
- name: Preserve line endings
run: git config --global core.autocrlf false

- name: Checkout
uses: actions/checkout@v2
with:
Expand All @@ -79,20 +87,14 @@ jobs:
registry-url: https://registry.npmjs.org/

- name: Install dependencies
env:
CI: true
run: npm ci

- name: Build
if: success()
run: npm run build
env:
CI: true

- name: Semantic Release
- name: Semantic Release # also runs lint and build
if: success()
run: HUSKY=0 npx semantic-release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: HUSKY=0 npx semantic-release
Original file line number Diff line number Diff line change
@@ -1,27 +1,19 @@
name: Lint, build, and scan
name: Test and build

on:
push:
branches-ignore:
- master
pull_request:
branches-ignore:
- master

jobs:
lint-build:
name: Lint and build
test:
name: Test

runs-on: ubuntu-latest

steps:
- name: Preserve line endings
run: git config --global core.autocrlf false

- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup Node.js 14
uses: actions/setup-node@v2
Expand All @@ -48,21 +40,26 @@ jobs:
env:
CI: true

- name: Build
run: npm run build
env:
CI: true

fossa-scan:
name: FOSSA scan
build:
name: Build

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: FOSSA scan
uses: fossas/fossa-action@main
- name: Setup Node.js 14
uses: actions/setup-node@v2
with:
api-key: ${{ secrets.FOSSA_API_KEY }}
node-version: 14

- name: Install dependencies
run: npm ci
env:
CI: true

- name: Build
run: npm run build
env:
CI: true
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"compile": "tsc",
"build": "npm-run-all clean compile",
"watch": "npm run build && npm link && nodemon",
"prepublishOnly": "npm-run-all typecheck prettier lint build",
"prepublishOnly": "npm-run-all prettier lint build",
"semantic-release": "cross-env HUSKY=0 semantic-release"
},
"dependencies": {
Expand Down

0 comments on commit 7ab5424

Please sign in to comment.