From 770ea8a9f4a171dd87a897a5097e9f03eed846d8 Mon Sep 17 00:00:00 2001 From: Bubinek <138865634+honzabubenik@users.noreply.github.com> Date: Thu, 2 May 2024 09:05:47 +0200 Subject: [PATCH] Add release CI (#52) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🔧 chore: Add release CI --- .github/workflows/.build.yml | 24 ------------------- .github/workflows/qa.yml | 25 ++++++++++++++++++++ .github/workflows/release.yml | 44 +++++++++++++++++++++++++++++++++++ .gitignore | 1 + 4 files changed, 70 insertions(+), 24 deletions(-) delete mode 100644 .github/workflows/.build.yml create mode 100644 .github/workflows/qa.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/.build.yml b/.github/workflows/.build.yml deleted file mode 100644 index 4dacd16..0000000 --- a/.github/workflows/.build.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: CI -on: [push, pull_request] -jobs: - execute: - runs-on: [self-hosted, Linux, aws] - env: - INPUT_TOKEN: "" - steps: - - name: Set work folder permissions - run: pwd && sudo chown -R $USER:$USER ./ - - uses: actions/checkout@v2 - - name: Setup Node.js environment - uses: actions/setup-node@v3 - with: - node-version: 16.x - - name: Install dependencies - run: npm ci - - name: Run unit tests - run: npm run test - - name: Publish to npm - uses: JS-DevTools/npm-publish@v1 - if: github.ref == 'refs/heads/main' - with: - token: ${{ secrets.NPM_AUTH_TOKEN }} diff --git a/.github/workflows/qa.yml b/.github/workflows/qa.yml new file mode 100644 index 0000000..ba397a0 --- /dev/null +++ b/.github/workflows/qa.yml @@ -0,0 +1,25 @@ +name: QA checks + +on: + pull_request: + branches: + - main + +jobs: + lint: + name: Tests + runs-on: [self-hosted, Linux] + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 16 + + - name: Install dependencies + run: npm ci + + - name: Run tests + run: npm run test diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..4023f85 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,44 @@ +name: Release CI + +on: + push: + branches: + - main + +permissions: + contents: write + pull-requests: write + +jobs: + ci: + name: CI Init + runs-on: [self-hosted, Linux] + outputs: + action: ${{ steps.init.outputs.action }} + steps: + - id: init + uses: localazy/release/init@v2 + + prepare: + name: Prepare Release PR + needs: ci + if: needs.ci.outputs.action == 'prepare' + runs-on: [self-hosted, Linux] + steps: + - uses: localazy/release/prepare@v2 + with: + app-id: ${{ secrets.AUTH_APP_ID }} + app-key: ${{ secrets.AUTH_APP_KEY }} + + publish: + name: Publish Release + needs: ci + if: needs.ci.outputs.action == 'publish' + runs-on: [self-hosted, Linux] + steps: + - uses: localazy/release/publish@v2 + with: + app-id: ${{ secrets.AUTH_APP_ID }} + app-key: ${{ secrets.AUTH_APP_KEY }} + npm-publish: public + npm-token: ${{ secrets.NPM_AUTH_TOKEN_PUBLIC }} diff --git a/.gitignore b/.gitignore index b36f88a..06f6129 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules .vscode/settings.json +.idea/