Skip to content

Commit

Permalink
feat: add release github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
sushichan044 committed Apr 20, 2024
1 parent 20d438b commit 9807bf6
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 1 deletion.
51 changes: 51 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Release

on:
push:
branches:
- main

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Setup Node.js 20.x
uses: actions/setup-node@v4
with:
node-version-file: "package.json"

- uses: pnpm/action-setup@v3
with:
run_install: false

- name: Get pnpm store directory
id: pnpm-store
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-store.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install Dependencies
run: pnpm install --frozen-lockfile

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
# This expects you to have a script called release which does a build for your packages and calls changeset publish
publish: pnpm release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"build:eslint": "pnpm --filter @virtual-live-lab/eslint-config build",
"build:prettier": "pnpm --filter @virtual-live-lab/prettier-config build",
"build": "pnpm run build:eslint && pnpm run build:prettier",
"publish": "pnpm run build && changeset publish && pnpm publish --access public --dry-run"
"release": "pnpm run build && changeset publish"
},
"files": [
"dist"
Expand Down

0 comments on commit 9807bf6

Please sign in to comment.