Skip to content
Merged
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
34 changes: 0 additions & 34 deletions .github/workflows/notify.yml

This file was deleted.

28 changes: 0 additions & 28 deletions .github/workflows/publish.yml

This file was deleted.

71 changes: 19 additions & 52 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: Release

on:
push:
tags:
- 'v*.*.*'
pull_request:
types: [closed]
branches:
- main

permissions:
contents: write
pull-requests: write

jobs:
release:
Expand All @@ -23,60 +23,27 @@ jobs:
node-version: 20
cache: yarn

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Configure Git
run: |
git config --global user.name 'github-actions'
git config --global user.email 'github-actions@github.com'

- name: Fetch all tags
run: git fetch --tags
git config user.name "github-actions"
git config user.email "github-actions@github.com"

- name: Extract version and previous tag
id: extract_info
- name: Extract version from package.json
id: extract_version
run: |
VERSION=${GITHUB_REF#refs/tags/v}
PREVIOUS_TAG=$(git describe --tags $(git rev-list --tags --skip=1 --max-count=1))
VERSION=$(jq -r '.version' package.json)
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "PREVIOUS_TAG=$PREVIOUS_TAG" >> $GITHUB_ENV
echo "Extracted version: $VERSION"

- name: Determine update type
id: determine_update_type
- name: Create Git tag
run: |
IFS='.' read -r -a NEW_VERSION_PARTS <<< "${VERSION}"
IFS='.' read -r -a OLD_VERSION_PARTS <<< "${PREVIOUS_TAG#v}"
git tag -a "${{ env.VERSION }}" -m "Release ${{ env.VERSION }}"
git push origin "${{ env.VERSION }}"

if [ "${NEW_VERSION_PARTS[0]}" != "${OLD_VERSION_PARTS[0]}" ]; then
UPDATE_TYPE=major
elif [ "${NEW_VERSION_PARTS[1]}" != "${OLD_VERSION_PARTS[1]}" ]; then
UPDATE_TYPE=minor
else
UPDATE_TYPE=patch
fi
echo "UPDATE_TYPE=$UPDATE_TYPE" >> $GITHUB_ENV

- name: Create and push new branch
run: |
NEW_BRANCH=release-v${VERSION}
git checkout -b ${NEW_BRANCH}
git push origin ${NEW_BRANCH}
echo "NEW_BRANCH=$NEW_BRANCH" >> $GITHUB_ENV
- name: Set up NPM auth
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc

- name: Update version in package.json
run: jq --arg new_version "$VERSION" '.version = $new_version' package.json > temp.json && mv temp.json package.json

- name: Build the package
run: yarn build

- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "Update version to ${{ env.VERSION }} [${{ env.UPDATE_TYPE }}] and upgrade dependencies"
branch: ${{ env.NEW_BRANCH }}
base: main
title: "Release ${{ env.VERSION }}"
body: "This PR updates the version to ${{ env.VERSION }} and upgrades dependencies."
labels: release
- name: Publish to npm
run: yarn publish --non-interactive
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
![npm](https://img.shields.io/npm/v/style-forge.patterns)
![license](https://img.shields.io/npm/l/style-forge.patterns)
![npm](https://img.shields.io/npm/dm/style-forge.patterns)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/ab57d699e51e43d686f9b0745aa60eaa)](https://app.codacy.com/gh/Style-Forge/patterns/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
![build](https://github.com/Style-Forge/patterns/actions/workflows/publish.yml/badge.svg)
![build](https://github.com/Style-Forge/patterns/actions/workflows/release.yml/badge.svg)

`Style-Forge.Patterns` is a versatile and efficient CSS utility library designed to simplify the creation and management of CSS patterns and utilities. It offers a comprehensive collection of pre-defined CSS classes, enabling developers to rapidly build responsive and consistent user interfaces without the need for writing repetitive styles from scratch.

Expand Down Expand Up @@ -62,6 +61,11 @@ If you feel awesome and want to support us in a small way, please consider starr
<td><img src="https://img.shields.io/npm/v/style-forge.colors" alt="npm"></td>
<td>Color palettes and styles for the project.</td>
</tr>
<tr>
<td><a href="https://github.com/Style-Forge/media">media</a></td>
<td><img src="https://img.shields.io/npm/v/style-forge.media" alt="npm"></td>
<td>Comprehensive CSS media query helpers for responsive web design.</td>
</tr>
</table>

## Contributing
Expand Down
2 changes: 1 addition & 1 deletion builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const [from, to] = ['src/all.css', 'patterns.css']
const css = fs.readFileSync(from, 'utf8')

const packageFile = JSON.parse(fs.readFileSync('package.json', 'utf8'))
const title = packageFile.name + ' v' + packageFile.version
const title = packageFile.name + ' ' + packageFile.version
const license = packageFile.license + ' License'
const link = packageFile.repository.url.replace('git+', '').replace('.git', '')
const header = '/*! ' + [title, license, link].join(' | ') + ' */'
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "style-forge.patterns",
"version": "2.0.19",
"version": "2025.1.8",
"description": "Style-Forge.Patterns - versatile CSS library with pre-defined classes for responsive, consistent user interfaces.",
"type": "module",
"main": "patterns.css",
Expand Down
2 changes: 1 addition & 1 deletion patterns.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading