Skip to content

Commit

Permalink
feat(): Angular 18 support
Browse files Browse the repository at this point in the history
  • Loading branch information
dimpu committed Oct 3, 2024
1 parent 82b7a06 commit c90eb5a
Show file tree
Hide file tree
Showing 8 changed files with 18,538 additions and 72 deletions.
83 changes: 37 additions & 46 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -1,55 +1,46 @@
name: npm-publish

on:
push:
branches:
- main

jobs:
create-tag:
release:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/github-tag-action@v6.0
# Step 1: Checkout the repository
- name: Checkout code
uses: actions/checkout@v3

# Step 2: Set up Node.js
- name: Set up Node.js
uses: actions/setup-node@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Create a GitHub release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
npm-publish:
name: npm-publish
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: '14.x'
registry-url: 'https://registry.npmjs.org'
- run: yarn install
- run: git config --global user.name "GitHub CD bot"
- run: git config --global user.email "buddhaaravind@gmail.com"
- run: npm version ${{ github.event.release.tag_name }}
- run: npm config set '//registry.npmjs.org/:_authToken' "${{ secrets.NPM_AUTH_TOKEN }}"
- run: yarn lib.build && cd dist/ngx-md
- run: git push
env:
# The secret is passed automatically. Nothing to configure.
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish if version has been updated
uses: pascalgn/npm-publish-action@1.3.9
with: # All of theses inputs are optional
tag_name: "v%s"
tag_message: "v%s"
create_tag: "true"
commit_pattern: "^Release (\\S+)"
workspace: "."
publish_command: "yarn"
publish_args: "--non-interactive"
env: # More info about the environment variables in the README
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Leave this as is, it's automatically generated
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} # You need to set this in your repo settings
node-version: '18'
registry-url: 'https://registry.npmjs.org/'

# Step 3: Install pnpm
- name: Install pnpm
run: |
npm install -g pnpm
# Step 4: Install dependencies with pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile

# Step 5: Build the library with pnpm
- name: Build ng-mdx
run: pnpm run lib.build

# Step 6: Copy the root README.md to the library folder
- name: Copy README.md to library folder
run: cp README.md dist/ngx-md/README.md

# Step 7: Run semantic-release to publish to npm
- name: Run semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
run: pnpx semantic-release
56 changes: 56 additions & 0 deletions .github/workflows/publish.yml.bkp
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: npm-publish
on:
push:
branches:
- main
jobs:
create-tag:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/github-tag-action@v6.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Create a GitHub release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
npm-publish:
name: npm-publish
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: '14.x'
registry-url: 'https://registry.npmjs.org'
- run: yarn install
- run: git config --global user.name "GitHub CD bot"
- run: git config --global user.email "buddhaaravind@gmail.com"
- run: npm version ${{ github.event.release.tag_name }}
- run: npm config set '//registry.npmjs.org/:_authToken' "${{ secrets.NPM_AUTH_TOKEN }}"
- run: yarn lib.build && cd dist/ngx-md
- run: git push
env:
# The secret is passed automatically. Nothing to configure.
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish if version has been updated
uses: pascalgn/npm-publish-action@1.3.9
with: # All of theses inputs are optional
tag_name: "v%s"
tag_message: "v%s"
create_tag: "true"
commit_pattern: "^Release (\\S+)"
workspace: "."
publish_command: "yarn"
publish_args: "--non-interactive"
env: # More info about the environment variables in the README
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Leave this as is, it's automatically generated
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} # You need to set this in your repo settings

35 changes: 35 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"branches": ["main"],
"tagFormat": "${version}",
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "angular"
}
],
"@semantic-release/release-notes-generator",
[
"@semantic-release/changelog",
{
"changelogFile": "dist/ngx-md/CHANGELOG.md"
}
],
[
"@semantic-release/npm",
{
"pkgRoot": "dist/ngx-md",
"npmPublish": true
}
],
[
"@semantic-release/git",
{
"assets": ["dist/ngx-md/package.json", "dist/ngx-md/CHANGELOG.md", "dist/ngx-md/README.md"],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
],
"@semantic-release/github"
]
}

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[![npm][opencollective]][opencollective]
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgit.luolix.top%2Fdimpu%2Fngx-md.svg?type=shield)](https://app.fossa.io/projects/git%2Bgit.luolix.top%2Fdimpu%2Fngx-md?ref=badge_shield)

Supports Angular2,4,5,6,7,12
Supports Angular2,4,5,6,7,12,18

Source @ [https://github.com/dimpu/ngx-md](https://github.com/dimpu/ngx-md)

Expand Down
Loading

0 comments on commit c90eb5a

Please sign in to comment.