Skip to content

Commit

Permalink
Dev (#169)
Browse files Browse the repository at this point in the history
* 📦 ci(.github): refactored release-please workflow and readded the npm-publish workflow (not tested)

* 🧪 test(index.njk): readded the generated home content to the home page

also refactored markup to loop back a more sensible layout

* 📦 ci(.github): fixed npm publish and release please actions to release when PR is merged

* 📦 ci(.github): fixed errors in indentation and syntax in workflows for releasing package

* 📦 ci(release-please.yml): fixed syntax and indentation
  • Loading branch information
prjctimg authored Apr 6, 2024
1 parent 883b5d2 commit e877d78
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 36 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

name: NPM package

on :
release:
types:
- "created"

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm i && npm run code:publish

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- run: |
npm i
npm test
env:
NPM_TOKEN: ${{secrets.NPM_PUBLISH}}
32 changes: 0 additions & 32 deletions .github/workflows/release-please-npm.yml

This file was deleted.

42 changes: 42 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
on:
push:
branches:
- main
name: release-please
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v4
id: release
with:
release-type: node
package-name: release-please-action
# The logic below handles the npm publication:
- uses: actions/checkout@v4
# these if statements ensure that a publication only occurs when
# a new release is created:
if: ${{ steps.release.outputs.release_created }}
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20

if: ${{ steps.release.outputs.release_created }}
- run: npm i
if: ${{ steps.release.outputs.release_created }}
- run: |
cat << EOF > "$HOME/.npmrc" //registry.npmjs.org/:_authToken=$NPM_PUBLISH EOF
env:
NPM_TOKEN:${{secrets.NPM_PUBLISH}}
if: ${{ steps.release.outputs.release_created }}
- name: Build package
run: cd huetiful
if: ${{ steps.release.outputs.release_created }}
- name: Run NPM publish
run: |
npm run code:publish
npm run publish
env:
NPM_TOKEN:${{secrets.NPM_PUBLISH}}
if: ${{ steps.release.outputs.release_created }}
10 changes: 6 additions & 4 deletions docs/assets/xml/views/index.njk
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{% extends "./layouts/base.njk" %}

{% block content %}

{{home.content}}
{% for mod, prop in home.demoData %}

<h2 class="font-mono text-slate-600 text-left text-lg font-semibold">Demos</h2>

<section class="flex-col bg-slate-100 my-3">
<h2 class="font-mono text-slate-600 text-left text-lg">Demos</h2>


<h3 class="font-sans text-xl font-semibold dark:text-slate-300 text-slate-700">{{mod}}</h3>

Expand All @@ -15,9 +17,9 @@
<h4 class="font-sans text-slate-700 dark:text-slate-300 font-semibold text-base">{{func}}</h4>
<p class="pt-3 font-sans text-slate-500 text-sm ">{{props.description}}</p>

<hr class="divide-y">
<hr class="divide-y-[1.75px] divide-slate-300 ">

<div class="flex space-x-2 p-2 flex-wrap">
<div class="flex space-x-2 flex-wrap">
{% if home.isColorCollection(props.expect) %}
{% for color in props.expect %}
<div class="flex-row space-y-2 flex-wrap items-start">
Expand Down

0 comments on commit e877d78

Please sign in to comment.