Skip to content

Commit

Permalink
Setup Publish Github Action
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinpalkovic committed Jan 3, 2024
1 parent 4f998f8 commit 4166c3d
Show file tree
Hide file tree
Showing 3 changed files with 1,261 additions and 16 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Release

on: [push]

jobs:
release:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')"
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Prepare repository
run: git fetch --unshallow --tags

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18

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

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install

- name: Create Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
pnpm build
pnpm publish
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
"format:write": "pnpm format --write",
"check": "biome check --apply ./src",
"check:apply": "pnpm check --apply",
"check:apply-unsafe": "pnpm check --apply-unsafe"
"check:apply-unsafe": "pnpm check --apply-unsafe",
"check:ci": "biome ci ./src",
"publish": "auto shipit"
},
"exports": {
".": {
Expand Down Expand Up @@ -58,6 +60,7 @@
"devDependencies": {
"@biomejs/biome": "^1.4.1",
"@storybook/types": "next",
"auto": "^11.0.4",
"tsup": "^8.0.1",
"typescript": "^5.3.3",
"webpack": "^5.89.0"
Expand Down
Loading

0 comments on commit 4166c3d

Please sign in to comment.