From 73fb8e5aa6a2eb02096dd985a24be2f39976891f Mon Sep 17 00:00:00 2001 From: Nikita Elfimov Date: Wed, 31 Jan 2024 15:41:11 +0300 Subject: [PATCH] feat: workflows --- .github/workflows/checks.yaml | 54 ++++++++-------------------------- .github/workflows/publish.yaml | 38 ++++-------------------- .github/workflows/stale.yml | 2 +- .github/workflows/version.yaml | 34 ++------------------- 4 files changed, 20 insertions(+), 108 deletions(-) diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index 3a01e9237..92c8dcd6d 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -3,45 +3,15 @@ name: Checks on: [pull_request] jobs: - run: - name: Run - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: '18.13' - - - name: Install - run: yarn install - env: - GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' - - - name: Lint - run: yarn checks lint - env: - GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' - - - name: TypeCheck - run: yarn checks typecheck - env: - GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' - - - name: TestUnit - run: yarn checks test unit - env: - GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' - - - name: TestIntegration - run: yarn checks test integration - env: - GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' - - - name: Release - run: yarn checks release - env: - GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' + check: + name: Typecheck, lint + uses: atls/tools/.github/workflows/reusable-checks.yaml@master + permissions: write-all + release: + name: Release + uses: atls/tools/.github/workflows/reusable-release.yaml@master + permissions: write-all + test: + name: Tests + uses: atls/tools/.github/workflows/reusable-tests.yaml@master + permissions: write-all diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index eeadcd922..a1c7506bb 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -4,37 +4,9 @@ on: workflow_dispatch: jobs: - run: + publish: name: Publish - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - ref: master - - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: '18.13' - - - name: Install - run: yarn install - - - name: Npm Publish - run: | - yarn version apply --all - yarn workspaces changed foreach --verbose --topological --no-private npm publish --access public - env: - YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - - name: Commit changes - uses: EndBug/add-and-commit@v9 - env: - GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' - with: - author_name: Atls Github Bot - author_email: github-bot@atls.team - message: 'chore(common): publish' - branch: master + uses: atls/tools/.github/workflows/reusable-publish.yaml@master + permissions: write-all + secrets: + npmAuthToken: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 718d43cb4..355ce8547 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -9,7 +9,7 @@ jobs: stale: runs-on: ubuntu-latest steps: - - uses: actions/stale@v8 + - uses: actions/stale@v9 with: repo-token: ${{ secrets.ISSUE_STALE }} stale-issue-message: 'Статус?' diff --git a/.github/workflows/version.yaml b/.github/workflows/version.yaml index ffe0ea623..70b07651e 100644 --- a/.github/workflows/version.yaml +++ b/.github/workflows/version.yaml @@ -9,35 +9,5 @@ on: jobs: run: name: Version - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - ref: master - - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: '18.13' - - - name: Install - run: yarn install - env: - GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' - - - name: Version - run: yarn workspaces changed foreach --no-private --verbose version patch --deferred - env: - GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' - - - name: Commit changes - uses: EndBug/add-and-commit@v9 - env: - GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' - with: - author_name: Atls Github Bot - author_email: github-bot@atls.team - message: 'chore(common): versions' - branch: master + uses: atls/tools/.github/workflows/reusable-version.yaml@master + permissions: write-all