Skip to content

Commit 4058eaa

Browse files
2 parents 79f191a + 42ce5cc commit 4058eaa

File tree

3 files changed

+111
-3
lines changed

3 files changed

+111
-3
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Update Changelog
2+
3+
on:
4+
push:
5+
branches:
6+
- main # Set this to the branch you want to trigger on
7+
release:
8+
types: [created]
9+
10+
jobs:
11+
update-changelog:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout Repository
15+
uses: actions/checkout@v4
16+
17+
- name: Set up Ruby
18+
uses: ruby/setup-ruby@v1
19+
with:
20+
ruby-version: '3.2.2' # Specify your Ruby version
21+
22+
- name: Install github_changelog_generator
23+
run: gem install github_changelog_generator
24+
25+
- name: Generate Changelog
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
run: |
29+
github_changelog_generator \
30+
--user visionary-code-works \
31+
--project HtmlScssClassChecker \
32+
--token ${{ secrets.GITHUB_TOKEN }} \
33+
--date-format "%Y-%m-%d" \
34+
--output "CHANGELOG.md" \
35+
--base "HISTORY.md" \
36+
--exclude-labels "duplicate,question,invalid,wontfix,Duplicate,Question,Invalid,Wontfix,Meta: Exclude From Changelog" \
37+
--summary-labels "Release summary,release-summary,Summary,summary" \
38+
--breaking-labels "backwards-incompatible,Backwards incompatible,breaking" \
39+
--enhancement-labels "enhancement,Enhancement,Type: Enhancement" \
40+
--bug-labels "bug,Bug,Type: Bug" \
41+
--deprecated-labels "deprecated,Deprecated,Type: Deprecated" \
42+
--removed-labels "removed,Removed,Type: Removed" \
43+
--security-labels "security,Security,Type: Security" \
44+
--header "# Changelog" \
45+
--merge-prefix "**Merged pull requests:**" \
46+
--issue-prefix "**Closed issues:**" \
47+
--breaking-prefix "**Breaking changes:**" \
48+
--enhancement-prefix "**Implemented enhancements:**" \
49+
--bug-prefix "**Fixed bugs:**" \
50+
--deprecated-prefix "**Deprecated:**" \
51+
--removed-prefix "**Removed:**" \
52+
--security-prefix "**Security fixes:**" \
53+
--simple-list \
54+
--verbose
55+
56+
- name: Commit and Push Changes
57+
run: |
58+
git config --local user.email "action@github.com"
59+
git config --local user.name "GitHub Action"
60+
git add CHANGELOG.md
61+
git commit -m "Update CHANGELOG.md"
62+
git push

.github/workflows/gem-push.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Ruby Gem CI/CD
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
build-and-publish:
11+
name: Build and Publish Gem
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v3
16+
17+
- name: Set up Ruby 3.2.2
18+
uses: ruby/setup-ruby@v1
19+
with:
20+
ruby-version: '3.2.2'
21+
22+
- name: Install dependencies
23+
run: bundle install
24+
25+
- name: Build Gem
26+
run: gem build *.gemspec
27+
28+
- name: Push to RubyGems
29+
run: |
30+
mkdir -p $HOME/.gem
31+
touch $HOME/.gem/credentials
32+
chmod 0600 $HOME/.gem/credentials
33+
printf -- "---\n:rubygems_api_key: ${RUBYGEMS_AUTH_TOKEN}\n" > $HOME/.gem/credentials
34+
gem push *.gem
35+
env:
36+
RUBYGEMS_AUTH_TOKEN: ${{ secrets.RUBYGEMS_AUTH_TOKEN }}
37+
38+
- name: Tag Incremental Version
39+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads/main')
40+
run: |
41+
git config --local user.email "action@github.com"
42+
git config --local user.name "GitHub Action"
43+
git tag -a v$(date +'%Y%m%d%H%M%S') -m "Automated tag from GitHub Actions"
44+
git push origin --tags

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# HtmlScssClassChecker
1+
# Html Scss Class Checker
2+
3+
[![Gem Version](https://badge.fury.io/rb/html_scss_class_checker.svg)](https://badge.fury.io/rb/html_scss_class_checker)
24

35
HtmlScssClassChecker is a Ruby gem for extracting and comparing class names from HTML and SCSS files. It helps in identifying unmatched or unused classes, enhancing the maintainability of front-end codebases.
46

@@ -70,5 +72,5 @@ Distributed under the MIT License. See [LICENSE](/LICENSE) for more information.
7072
- [Code of Conduct](/CODE_OF_CONDUCT.md): Guidelines for participation in the community.
7173
- [Development Guide](/docs/development.md): Instructions for setting up a development environment and working on the gem.
7274
- [Testing Guide](/docs/testing.md): Information on how to run and write tests for the gem.
73-
- [Usage Documentation](`/docs/usage.md`): Provide detailed instructions on how to use the gem, including various configurations and options.
74-
- [Contributing Guidelines](`/CONTRIBUTING.md`):** Outline how others can contribute to your project. Include information on coding standards, pull request processes, and issue reporting guidelines.
75+
- [Usage Documentation](/docs/usage.md): Provide detailed instructions on how to use the gem, including various configurations and options.
76+
- [Contributing Guidelines](/CONTRIBUTING.md): Outline how others can contribute to your project. Include information on coding standards, pull request processes, and issue reporting guidelines.

0 commit comments

Comments
 (0)