Skip to content

Commit

Permalink
ci: setup release
Browse files Browse the repository at this point in the history
  • Loading branch information
s-r-x committed Apr 20, 2022
1 parent c9dcc6b commit 4d848fa
Show file tree
Hide file tree
Showing 7 changed files with 18,919 additions and 2,862 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"plugins": ["@typescript-eslint"],
"rules": {
"@typescript-eslint/no-explicit-any": 0,
"prettier/prettier": "error"
"prettier/prettier": "warn"
}
}
21 changes: 21 additions & 0 deletions .github/actions/bootstrap/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: "Bootstrap"
runs:
using: "composite"
steps:
- uses: actions/setup-node@v2
with:
node-version: "16.4"
- uses: actions/cache@v2
id: npm_cache
with:
path: ./node_modules
key: deps-${{ hashFiles('package-lock.json') }}
- name: Install dependencies
run: |
if echo ${{ steps.npm_cache.outputs.cache-hit }} | grep -c "true"
then
echo "Cache hit - skipping dependency installation"
else
npm ci
fi
shell: bash
33 changes: 0 additions & 33 deletions .github/workflows/main.yml

This file was deleted.

27 changes: 27 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: PR
on:
pull_request:
branches: ['master']

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/bootstrap
- run: npm run lint:strict
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/bootstrap
- run: npm run test
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/bootstrap
- run: npm run build
57 changes: 22 additions & 35 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,39 @@
name: Release
on:
release:
types: [created]
push:
branches: ['master']

jobs:
lint:
name: 'Lint'
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '12.x'
- uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
- run: npm ci
- run: npm run lint
- uses: ./.github/actions/bootstrap
- run: npm run lint:strict
preBuild:
name: preBuild
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/bootstrap
- run: npm run build
test:
name: 'Tests'
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '12.x'
- uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
- run: npm ci
- uses: ./.github/actions/bootstrap
- run: npm run test
publish:
name: 'Publish'
release:
name: Release
runs-on: ubuntu-latest
needs: [lint, test]
needs: [lint, test, preBuild]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '12.x'
registry-url: https://registry.npmjs.org/
- uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
- run: npm ci
- run: npm publish --access public
- uses: ./.github/actions/bootstrap
- name: Release
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm run semantic-release
Loading

0 comments on commit 4d848fa

Please sign in to comment.