From 2fc055866c3b59403ea5f54c8af46efbbbcc89b3 Mon Sep 17 00:00:00 2001 From: Gordon Leigh Date: Fri, 4 Oct 2024 19:23:08 +0200 Subject: [PATCH] Build: add GitHub Actions workflow --- .github/workflows/pr.yaml | 30 +++++++++++++++++++++++++++ .github/workflows/release.yaml | 38 ++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 .github/workflows/pr.yaml create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml new file mode 100644 index 0000000..4ad75b6 --- /dev/null +++ b/.github/workflows/pr.yaml @@ -0,0 +1,30 @@ +name: Build and Test +on: + pull_request: + +jobs: + build: + name: Build and Test + runs-on: ubuntu-latest + + steps: + - name: Git Checkout + uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: "22.x" + cache: "npm" + registry-url: "https://registry.npmjs.org" + + - name: NPM install + run: npm ci + + - name: Test + run: npm run test + + - name: Compile + run: npm run compile + + - name: Lint + run: npm run lint diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..d5081ee --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,38 @@ +name: Release +on: + push: + branches: + - main + +jobs: + build: + name: Release + runs-on: ubuntu-latest + + steps: + - name: Git Checkout + uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: "22.x" + cache: "npm" + registry-url: "https://registry.npmjs.org" + + - name: NPM install + run: npm ci + + - name: Test + run: npm run test + + - name: Compile + run: npm run compile + + - name: Lint + run: npm run lint + + - name: Release + run: npm run release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}