Skip to content

Commit

Permalink
ci: add linter and release workflow, remove manual vercel deployment (#…
Browse files Browse the repository at this point in the history
…24)

* ci: remove manual vercel deployment workflow

* ci: separate build workflow

* ci: add linter ci

* ci: add release ci

* ci: release workflow -- fix path

* ci: release workflow -- use tag name on zip file

* fix typo workflow name

* ci: add workflow_call on build.yaml

* fix build release zip path

* test linter

* test linter error catch

* add linter errors annotation matcher

* revert linter error test

* nits: add Release Workflows name
  • Loading branch information
heronimus authored Apr 2, 2024
1 parent 4586fa8 commit 7df1a28
Show file tree
Hide file tree
Showing 4 changed files with 118 additions and 132 deletions.
132 changes: 0 additions & 132 deletions .github/workflows/build-preview.yaml

This file was deleted.

49 changes: 49 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Build

on:
pull_request:
push:
branches:
- main
workflow_call:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref || github.run_id }}
cancel-in-progress: true

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout Cardinal Editor
uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: 8
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- name: Build
run: pnpm build
- name: Archive Release
uses: thedoctor0/[email protected]
with:
type: 'zip'
filename: 'cardinal-editor.zip'
path: ./dist/
- name: Upload Build to Github artifact
uses: actions/upload-artifact@v4
with:
name: cardinal-editor
path: cardinal-editor.zip
38 changes: 38 additions & 0 deletions .github/workflows/lint-ts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Lint

on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref || github.run_id }}
cancel-in-progress: true

jobs:
lint-ts:
name: Typescript
runs-on: ubuntu-latest
steps:
- name: Checkout Cardinal Editor
uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: 8
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- name: Lint
run: pnpm lint
31 changes: 31 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Release

on:
release:
types: [created]

permissions:
contents: write

jobs:
build:
name: Build
uses: ./.github/workflows/build.yaml

release:
name: Release Build Package
runs-on: ubuntu-latest
needs: build
steps:
- name: Download Cardinal-Editor build
uses: actions/download-artifact@v4
- name: Rename build with tag
run: |
ls -R
mv cardinal-editor/cardinal-editor.zip cardinal-editor-${{ github.event.release.tag_name }}.zip
- name: Publish Build to corresponding Github Release
uses: skx/github-action-publish-binaries@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: 'cardinal-editor-${{ github.event.release.tag_name }}.zip'

0 comments on commit 7df1a28

Please sign in to comment.