Skip to content

Commit

Permalink
Add workflows (#14)
Browse files Browse the repository at this point in the history
* Add workflows

* Update lock file
  • Loading branch information
licitdev authored Nov 24, 2022
1 parent eaeb68b commit 37b1a27
Show file tree
Hide file tree
Showing 5 changed files with 114 additions and 80 deletions.
38 changes: 38 additions & 0 deletions .github/actions/prepare/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Prepare
description: Install and build the app

runs:
using: 'composite'
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16

- uses: pnpm/[email protected]
name: Install pnpm
id: pnpm-install
with:
version: 7
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
shell: bash
run: pnpm install
1 change: 1 addition & 0 deletions .github/funding.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: [directus, benhaynes, rijkvanzanten]
31 changes: 31 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Check

on:
pull_request:
branches: ['main']
push:
branches: ['main']

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

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

- name: Prepare
uses: ./.github/actions/prepare

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: javascript

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Push Release

on:
push:
tags:
- 'v*.*.*'

permissions:
contents: read

jobs:
release:
permissions:
contents: write
name: Build & Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Prepare
uses: ./.github/actions/prepare

- name: Build dist
run: pnpm build

- name: Publish Packages
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
pnpm config set "//registry.npmjs.org/:_authToken" "${NPM_TOKEN}"
pnpm publish --access=public --no-git-checks
- name: GitHub Release
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
87 changes: 7 additions & 80 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 37b1a27

Please sign in to comment.