Skip to content
This repository has been archived by the owner on Sep 13, 2024. It is now read-only.

Refactor pipeline #230

Merged
merged 3 commits into from
Jul 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
custom: ["https://www.buymeacoffee.com/AlexTorresDev", "https://www.paypal.me/hapovedat"]
github: AlexTorresDev
16 changes: 0 additions & 16 deletions .github/stale.yml

This file was deleted.

81 changes: 68 additions & 13 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,84 @@
name: NPM Publish
name: Build & Publish

on:
push:
branches: [main]
branches:
- main
pull_request:
branches:
- main
types: [opened, synchronize]

workflow_dispatch:

jobs:
npm-publish:
avoid_redundant:
name: ❌ Avoid redundant builds
runs-on: ubuntu-22.04
steps:
- name: ⬇️ Checkout repository
- uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

build:
name: 📦 Build
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
- uses: actions/setup-node@v3
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: "18.x"
registry-url: https://registry.npmjs.org/

- name: 📦 Install dependencies
run: npm ci

- name: ✅ Build package
run: npm run build
- uses: pnpm/action-setup@v2
with:
version: 7
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --no-frozen-lockfile
- name: Build package
run: pnpm build
- name: Copy files to dist
run: |
cp LICENSE dist/
cp README.md dist/
cp package.json dist/
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: cet-package
path: dist

publish:
name: 🚀 Publish
if: github.event_name == 'push'
needs: build
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: "18.x"
registry-url: https://registry.npmjs.org/
- name: Get artifact
uses: actions/download-artifact@v3
with:
name: cet-package
- name: 🚀 Publish package to NPM
run: npm publish --access public
run: ls -l
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ tsconfig.json
npm-debug.log
.babelrc
.eslintrc
.prettierrc.json
.prettierrc
File renamed without changes.
Loading