From 192689c14f8c49303c06755c5cb8243de1be7d9f Mon Sep 17 00:00:00 2001 From: Andrei Volkov Date: Sat, 21 Oct 2023 13:29:00 -0600 Subject: [PATCH] feat: updated workflows --- .github/workflows/build-and-release.yml | 33 --------------------- .github/workflows/build-test-release.yml | 32 ++++++++++++++++++++ .github/workflows/checkout-install.yml | 24 +++++++++++++++ .github/workflows/test.yml | 37 ------------------------ 4 files changed, 56 insertions(+), 70 deletions(-) delete mode 100644 .github/workflows/build-and-release.yml create mode 100644 .github/workflows/build-test-release.yml create mode 100644 .github/workflows/checkout-install.yml delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml deleted file mode 100644 index a03c98f..0000000 --- a/.github/workflows/build-and-release.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Build and release - -on: push - -concurrency: - group: build-and-release - cancel-in-progress: true - -jobs: - release: - runs-on: ${{ matrix.os }} - - strategy: - matrix: - os: [windows-latest] - - steps: - - name: Check out the repo - uses: actions/checkout@v4 - - - name: Install Node.js and npm - uses: actions/setup-node@v3 - with: - node-version: 16 - cache: npm - - - name: Install dependencies - run: npm install - - - name: Build and release the app - run: npm package:publish - env: - GH_TOKEN: ${{ secrets.github_token }} diff --git a/.github/workflows/build-test-release.yml b/.github/workflows/build-test-release.yml new file mode 100644 index 0000000..4dc2f99 --- /dev/null +++ b/.github/workflows/build-test-release.yml @@ -0,0 +1,32 @@ +name: Build, test, and release + +on: + push: + branches: + - main + workflow_dispatch: + +concurrency: + group: build-test-release + cancel-in-progress: true + +jobs: + common: + uses: ./.github/workflows/checkout-install.yml + + test: + steps: + - name: Run tests + run: | + npm run package + npm run lint + npm exec tsc + npm test + + build-and-release: + needs: test + steps: + - name: Build and release the app + env: + GH_TOKEN: ${{ secrets.github_token }} + run: npm run package:publish diff --git a/.github/workflows/checkout-install.yml b/.github/workflows/checkout-install.yml new file mode 100644 index 0000000..33aca90 --- /dev/null +++ b/.github/workflows/checkout-install.yml @@ -0,0 +1,24 @@ +name: Common steps workflow + +on: + workflow_call: + +jobs: + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [windows-latest] + + steps: + - name: Check out the repo + uses: actions/checkout@v4 + + - name: Install Node.js and npm + uses: actions/setup-node@v3 + with: + node-version: 16 + cache: npm + + - name: Install dependencies + run: npm install diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index b256cd9..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Test - -on: [push, pull_request] - -concurrency: - group: test - cancel-in-progress: true - -jobs: - release: - runs-on: ${{ matrix.os }} - - strategy: - matrix: - os: [windows-latest] - - steps: - - name: Check out Git repository - uses: actions/checkout@v4 - - - name: Install Node.js and npm - uses: actions/setup-node@v3 - with: - node-version: 16 - cache: npm - - - name: Install dependencies - run: npm install - - - name: Run tests - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - npm run package - npm run lint - npm exec tsc - npm test