From 16a97f1e83935d39b4bc91b40433fbe1928130f0 Mon Sep 17 00:00:00 2001 From: Nikita Elfimov Date: Tue, 13 Aug 2024 14:15:56 +0300 Subject: [PATCH] feat(github): shared workflows --- .github/workflows/checks.yaml | 11 ++++--- .github/workflows/publish.yaml | 2 +- .github/workflows/release.yaml | 52 +++++++++++----------------------- .github/workflows/version.yaml | 7 +++-- 4 files changed, 29 insertions(+), 43 deletions(-) diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index 92c8dcd6d..ba7a447ec 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -1,17 +1,20 @@ name: Checks -on: [pull_request] +on: + pull_request: + paths-ignore: + - '.github/**' jobs: check: name: Typecheck, lint - uses: atls/tools/.github/workflows/reusable-checks.yaml@master + uses: atls/shared/.github/workflows/checks.yaml@master permissions: write-all release: name: Release - uses: atls/tools/.github/workflows/reusable-release.yaml@master + uses: atls/shared/.github/workflows/release.yaml@master permissions: write-all test: name: Tests - uses: atls/tools/.github/workflows/reusable-tests.yaml@master + uses: atls/shared/.github/workflows/tests.yaml@master permissions: write-all diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index a1c7506bb..ea36cc49f 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -6,7 +6,7 @@ on: jobs: publish: name: Publish - uses: atls/tools/.github/workflows/reusable-publish.yaml@master + uses: atls/shared/.github/workflows/publish.yaml@master permissions: write-all secrets: npmAuthToken: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index e806159eb..8dc240746 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,42 +1,22 @@ name: Release on: - workflow_run: - workflows: - - Publish + pull_request: + branches: + - master types: - - completed + - closed + paths-ignore: + - '.github/**' jobs: - run: - name: Release - 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: Install Buildpack Cli - run: | - (curl -sSL "https://github.com/buildpacks/pack/releases/download/v0.23.0/pack-v0.23.0-linux.tgz" | sudo tar -C /usr/local/bin/ --no-same-owner -xzv pack) - - - name: Login to Yandex Container Registry - run: echo -e $YCR_KEYFILE | docker login -u json_key --password-stdin cr.yandex - env: - YCR_KEYFILE: ${{ secrets.YCR_KEYFILE }} - - - name: Release - env: - GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' - run: | - yarn workspaces changed foreach image pack --publish --tag-policy hash-timestamp --registry 'cr.yandex/${{ secrets.YCR_PROJECT_ID }}/' + release: + uses: atls/shared/.github/workflows/pack-image.yaml@master + permissions: write-all + with: + registryURL: 'ghcr.io' + registryUser: ${{ github.repository_owner }} + project: ${{ github.repository_owner }} + nodeVersion: '20' + secrets: + registryKey: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/version.yaml b/.github/workflows/version.yaml index 70b07651e..f78475352 100644 --- a/.github/workflows/version.yaml +++ b/.github/workflows/version.yaml @@ -2,12 +2,15 @@ name: Version on: pull_request: - types: [closed] + types: + - closed branches: - master + paths-ignore: + - '.github/**' jobs: run: name: Version - uses: atls/tools/.github/workflows/reusable-version.yaml@master + uses: atls/shared/.github/workflows/version.yaml@master permissions: write-all