From 245d7a7a389048ee5a8113f6cdd72ca82cfb93fc Mon Sep 17 00:00:00 2001 From: "Dr. Vortex" Date: Tue, 31 Oct 2023 16:18:05 -0500 Subject: [PATCH] Added ci/cd workflows --- .github/workflows/ci.yaml | 71 ++++++++++++++++++++++++++++++++++ .github/workflows/release.yaml | 31 +++++++++++++++ 2 files changed, 102 insertions(+) create mode 100644 .github/workflows/ci.yaml create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..23d81a8 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,71 @@ +name: Continuous Integration + +on: + push: + branches: + - main + workflow_call: + workflow_dispatch: + pull_request: + types: [synchronize] + +jobs: + ci: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + name: ${{ matrix.os }} + permissions: + contents: read + id-token: write + defaults: + run: + shell: bash + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: 18 + + - name: Install dependencies + run: npm install + + - name: Formatting + run: npm run format:check + + - name: Linting + run: npm run lint + + - name: Build + run: npm run build + + docs: + needs: ci + runs-on: ubuntu-latest + permissions: + contents: write + id-token: write + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: 18 + + - name: Install dependencies + run: npm install + + - name: Build docs + run: npm run build:docs + + - name: Deploy docs + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./docs diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..5f32f43 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,31 @@ +name: Release + +on: + release: + types: [created] + +jobs: + ci: + uses: ./.github/workflows/ci.yaml + release: + runs-on: ubuntu-latest + needs: ci + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup npm authenication + uses: actions/setup-node@v3 + with: + registry-url: https://registry.npmjs.org/ + + - name: Install dependencies + run: npm install + + - name: Build + run: npm run build + + - name: Publish + run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.npm_token}}