diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..5a7550c --- /dev/null +++ b/.github/workflows/build.yml @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..78c692f --- /dev/null +++ b/.github/workflows/release.yml @@ -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 }} diff --git a/.gitignore b/.gitignore index 9602720..e815d17 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,6 @@ src/design/tokens/semantic.tokens.ts src/design/presets/lfx.preset.ts src/design/presets/index.ts -src/index.ts \ No newline at end of file +src/index.ts + +.github/.DS_Store \ No newline at end of file