diff --git a/.github/workflows/release-publish.yml b/.github/workflows/release-publish.yml new file mode 100644 index 0000000..c0cec8c --- /dev/null +++ b/.github/workflows/release-publish.yml @@ -0,0 +1,53 @@ +name: Release Publish + +on: + release: + types: [published] + +jobs: + release: + runs-on: ubuntu-latest + permissions: + contents: write + packages: write + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + + - run: npm ci + - run: npm run format:check + - run: npm run build + - run: npm run test:run + + - name: Pack release zip + id: pack + run: | + PACKAGE_TGZ=$(npm pack --silent) + PACKAGE_ZIP="${PACKAGE_TGZ%.tgz}.zip" + zip -9 "$PACKAGE_ZIP" "$PACKAGE_TGZ" + echo "package_zip=$PACKAGE_ZIP" >> "$GITHUB_OUTPUT" + + - name: Upload release asset + uses: softprops/action-gh-release@v2 + with: + files: ${{ steps.pack.outputs.package_zip }} + + - name: Setup GitHub Packages registry + uses: actions/setup-node@v4 + with: + node-version: 20 + registry-url: https://npm.pkg.github.com + scope: "@fabiogaming" + + - name: Set GitHub Packages scope + run: npm pkg set name=@fabiogaming/jsx-utils + + - name: Publish to GitHub Packages + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index d722ed0..c344462 100644 --- a/README.md +++ b/README.md @@ -31,14 +31,14 @@ JSX-Utils features both this, as well as a built in documentation that you can v To get started with JSX Utils you can install it both through NPM as well as GitHub's package registry -NPM Install (recommended): `npm install @fabi-dev/jsx-utils` +NPM Install (recommended): `npm install @fabiothefox/jsx-utils` -GitHub Install: `npm install @fabi-dev/jsx-utils --registry=https://npm.pkg.github.com` +GitHub Install: `npm install @fabiogaming/jsx-utils --registry=https://npm.pkg.github.com` **Note** For GitHub the installation might require some additional steps, such as: -- Creating an `.npmrc` file with the following content: `@fabi-dev:registry=https://npm.pkg.github.com` at the root of your project +- Creating an `.npmrc` file with the following content: `@fabiogaming:registry=https://npm.pkg.github.com` at the root of your project - Logging into the GitHub package registry: `npm login --registry=https://npm.pkg.github.com` ### 2.2 Added JSX-Nodes With Examples diff --git a/package.json b/package.json index 85ad652..55eebc7 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "@fabi-dev/jsx-utils", + "name": "@fabiothefox/jsx-utils", "version": "1.0.0", "description": "SolidJS-inspired JSX control flow utilities for React ecosystems", "license": "MIT",