Skip to content

Commit

Permalink
added gha
Browse files Browse the repository at this point in the history
Signed-off-by: Asitha de Silva <[email protected]>
  • Loading branch information
asithade committed Nov 11, 2024
1 parent f3a7eee commit a3ce6ba
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 1 deletion.
25 changes: 25 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Build Check

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

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

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build
39 changes: 39 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Release

on:
push:
tags:
- "v*.*.*"

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"

- name: Install dependencies
run: npm ci

- name: Extract version from tag
id: get_version
run: |
TAG=${GITHUB_REF#refs/tags/v}
echo "VERSION=$TAG" >> $GITHUB_OUTPUT
- name: Update package version
run: |
npm version ${{ steps.get_version.outputs.VERSION }} --no-git-tag-version --allow-same-version
- name: Build
run: npm run build

- name: Publish to NPM
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ src/design/tokens/semantic.tokens.ts

src/design/presets/lfx.preset.ts
src/design/presets/index.ts
src/index.ts
src/index.ts

.github/.DS_Store

0 comments on commit a3ce6ba

Please sign in to comment.