From b54946972bb2a2acd136e7c730f2a70de7715ae3 Mon Sep 17 00:00:00 2001 From: Artem Zakharchenko Date: Wed, 18 Oct 2023 10:20:16 +0200 Subject: [PATCH] chore: split ci and release workflows --- .github/workflows/ci.yml | 39 +------------------------------- .github/workflows/release.yml | 42 +++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 38 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 70af50e..25da508 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,17 +5,14 @@ on: branches: - main pull_request: - branches: - - main + workflow_dispatch: jobs: build: runs-on: ubuntu-latest - strategy: matrix: node-version: [16, 18] - steps: - name: Checkout uses: actions/checkout@v2 @@ -35,37 +32,3 @@ jobs: - name: Unit tests run: yarn test - - release: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 - token: ${{ secrets.GH_ADMIN_TOKEN }} - - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: 16 - always-auth: true - cache: yarn - - - name: Setup Git - run: | - git config --local user.name "kettanaito" - git config --local user.email "kettanaito@gmail.com" - - - name: Install dependencies - run: yarn install --frozen-lockfile - - - name: Build - run: yarn build - - - name: Release - if: contains(github.ref, 'refs/heads/main') - run: yarn release - env: - GITHUB_TOKEN: ${{ secrets.GH_ADMIN_TOKEN }} - NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..b30cfb3 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,42 @@ +name: release + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + token: ${{ secrets.GH_ADMIN_TOKEN }} + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: 18 + always-auth: true + cache: yarn + + - name: Setup Git + run: | + git config --local user.name "kettanaito" + git config --local user.email "kettanaito@gmail.com" + + - name: Install dependencies + run: yarn install --frozen-lockfile + + - name: Build + run: yarn build + + - name: Release + if: contains(github.ref, 'refs/heads/main') + run: yarn release + env: + GITHUB_TOKEN: ${{ secrets.GH_ADMIN_TOKEN }} + NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}