Skip to content

Commit

Permalink
workflow upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
3axap4eHko committed Mar 10, 2024
1 parent 42cd3cd commit c0b1e8f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 107 deletions.
48 changes: 8 additions & 40 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,45 +5,13 @@ on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org/

- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: 8
run_install: false

- name: Environment log
id: env
run: |
node --version
pnpm --version
- name: Install dependencies
run: |
pnpm install --frozen-lockfile
- name: Run build process
run: |
pnpm build
- name: Run testing
run: |
pnpm test
pnpm test:build
- name: Upload test coverage
uses: codecov/codecov-action@v3
- name: Run CI/CD Pipeline
uses: zource-dev/action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
node_version: '20.x'
github_token: ${{ secrets.GITHUB_TOKEN }}
codecov_token: ${{ secrets.CODECOV_TOKEN }}
test: |
pnpm test
pnpm test:build
79 changes: 12 additions & 67 deletions .github/workflows/upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,72 +8,17 @@ on:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- name: Checkout code 🛎️
uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }} 🟢
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org/

- name: Install pnpm ⚙️
uses: pnpm/action-setup@v3
- name: Run CI/CD Pipeline
uses: zource-dev/action@v1
with:
version: 8
run_install: false

- name: Environment log ⚙️
id: env
run: |
node --version
pnpm --version
- name: Install dependencies 🔧
run: |
pnpm install --frozen-lockfile
- name: Upgrade 🌠
id: updates
run: |
PENDING=$(pnpm outdated --json|jq length)
echo "::set-output name=PENDING::$PENDING"
pnpm up --latest
DONE=$(pnpm outdated --json|jq length)
echo "::set-output name=DONE::$DONE"
- name: Build process 🧱
if: steps.updates.outputs.PENDING != steps.updates.outputs.DONE
run: |
pnpm build
- name: Test 🧪
if: steps.updates.outputs.PENDING != steps.updates.outputs.DONE
run: |
pnpm test
pnpm test:build
- name: Commit 🔒
if: steps.updates.outputs.PENDING != steps.updates.outputs.DONE
run: |
git config --global user.email "[email protected]"
git config --global user.name "Ivan Zakharchanka"
git add --all
git commit -am "autoupdate"
npm version patch
- name: Push
if: steps.updates.outputs.PENDING != steps.updates.outputs.DONE
run: |
git push
git push --tags
- name: Publish 📚
if: steps.updates.outputs.PENDING != steps.updates.outputs.DONE
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
npm publish
node_version: '20.x'
github_token: ${{ secrets.GITHUB_TOKEN }}
autoupdate: minor
username: Ivan Zakharchanka
email: [email protected]
npm_token: ${{ secrets.NPM_TOKEN }}
codecov_token: ${{ secrets.CODECOV_TOKEN }}
test: |
pnpm lint
pnpm test

0 comments on commit c0b1e8f

Please sign in to comment.