Skip to content
Open
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
79 changes: 79 additions & 0 deletions .github/workflows/default.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: vite-classname-blacklist - default

on:
push:
branches:
- "main"
release:
types: [created]
schedule:
- cron: "0 6 * * 1" # At 06:00 on Monday
workflow_dispatch: # to run from the Actions tab on GitHub

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 #checkout full history so we can get the latest tag
- uses: actions/setup-node@v4
with:
node-version: "24"
registry-url: "https://registry.npmjs.org"
- uses: pnpm/action-setup@v4
with:
version: latest

# if i run the deployment of the github pages from the github web ui, without a release, then there is no github.event.release...
- name: get latest tag
id: get_latest_tag
run: |
LATEST_TAG=$(git tag --sort=-version:refname | head -n 1)
echo latest_tag=${LATEST_TAG} >> $GITHUB_OUTPUT

- name: Install
run: pnpm install

- name: Build Library
run: pnpm run build

publish:
needs: build
if: ${{ github.event_name == 'release' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "24"
registry-url: "https://registry.npmjs.org"
- uses: pnpm/action-setup@v4
with:
version: latest

- name: Get release version
id: release
run: |
FULL_VERSION=${{ github.event.release.tag_name }}
SHORT_VERSION=${FULL_VERSION:1}
echo short_version=${SHORT_VERSION} >> $GITHUB_OUTPUT

- name: Configure Git user
run: |
git config user.email "[email protected]"
git config user.name "GitHub Actions"

- name: Update release version
run: npm version --no-git-tag-version ${{ steps.release.outputs.short_version }}

- name: Install Dependencies
run: pnpm install

- name: Build Release
run: pnpm run build

- name: Publish to npmjs
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_PUBLISH_TOKEN}}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,4 @@ dist
.vscode
.idea
AGENTS.md
.github
linked-planet-vite-plugin*.tgz