Skip to content

Commit

Permalink
Merge pull request #6 from s0ftik3/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
s0ftik3 authored May 28, 2023
2 parents 23a0c18 + 2ea002f commit e57192d
Show file tree
Hide file tree
Showing 12 changed files with 798 additions and 208 deletions.
29 changes: 0 additions & 29 deletions .github/workflows/format.yml

This file was deleted.

123 changes: 123 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
name: Release Library
on:
workflow_dispatch:
push:
tags:
- "v*"
branches:
- main
- master
- develop

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: write

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 2

- uses: pnpm/[email protected]

- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 18
cache: pnpm

- name: Install dependencies
run: pnpm install

- name: Build
run: pnpm build

#- name: Test
# run: pnpm run test
# env:
# CI: true

- name: Archive the build
uses: actions/upload-artifact@v3
with:
name: production-files
path: dist
retention-days: 5
if-no-files-found: error
deploy:
runs-on: ubuntu-latest
name: Deploy
needs: [build]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Create Directory
run: mkdir -p dist
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: production-files
path: ./dist
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18
- run: npm install -g conventional-changelog-conventionalcommits
- run: npm install -g [email protected]
- run: npm install -g @semantic-release/exec
- run: npm install -g @semantic-release/npm
- run: npm install -g @semantic-release/git
- run: npm install -g @semantic-release/release-notes-generator
- run: npm install -g @semantic-release/changelog
- run: npm install -g @semantic-release/github
- name: Release
env:
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}
run: |
sudo apt-get install -y jq
chmod +x ./scripts/prepareCMD.sh
semantic-release
cleanup:
name: Cleanup build artifacts
needs:
- deploy
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: "♻️ remove build artifacts"
uses: geekyeggo/delete-artifact@v1
with:
name: production-files

format:
name: Format code
needs:
- cleanup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/[email protected]
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
run: pnpm install
- name: Format code base
run: pnpm format
- name: Add, Commit and Push formatted code
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: 'refactor: Format'
39 changes: 0 additions & 39 deletions .github/workflows/tests.yml

This file was deleted.

194 changes: 194 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
{
"branches": [
"main",
"master",
"release",
{
"name": "develop",
"prerelease": true
}
],
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "conventionalcommits",
"parserOpts": {
"noteKeywords": [
"BREAKING CHANGE",
"BREAKING CHANGES",
"BREAKING"
]
},
"releaseRules": [
{
"breaking": true,
"release": "major"
},
{
"type": "feat",
"release": "minor"
},
{
"type": "fix",
"release": "patch"
},
{
"type": "perf",
"release": "patch"
},
{
"type": "revert",
"release": "patch"
},
{
"type": "docs",
"scope": "docs-*",
"release": "minor"
},
{
"type": "docs",
"release": false
},
{
"type": "style",
"release": "patch"
},
{
"type": "refactor",
"release": "patch"
},
{
"type": "test",
"release": "patch"
},
{
"type": "build",
"release": "patch"
},
{
"type": "ci",
"scope": "ci-*",
"release": "patch"
},
{
"type": "chore",
"release": false
},
{
"type": "no-release",
"release": false
}
]
}
],
[
"@semantic-release/release-notes-generator",
{
"preset": "conventionalcommits",
"parserOpts": {
"noteKeywords": [
"BREAKING CHANGE",
"BREAKING CHANGES",
"BREAKING"
]
},
"writerOpts": {
"commitsSort": [
"subject",
"scope"
]
},
"presetConfig": {
"types": [
{
"type": "feat",
"section": "πŸ• Features"
},
{
"type": "feature",
"section": "πŸ• Features"
},
{
"type": "fix",
"section": "πŸ› Bug Fixes"
},
{
"type": "perf",
"section": "πŸ”₯ Performance Improvements"
},
{
"type": "revert",
"section": "⏩ Reverts"
},
{
"type": "docs",
"section": "πŸ“ Documentation"
},
{
"type": "style",
"section": "🎨 Styles"
},
{
"type": "refactor",
"section": "πŸ§‘β€πŸ’» Code Refactoring"
},
{
"type": "test",
"section": "βœ… Tests"
},
{
"type": "build",
"section": "πŸ€– Build System"
},
{
"type": "ci",
"section": "πŸ” Continuous Integration"
}
]
}
}
],
[
"@semantic-release/changelog",
{
"changelogTitle": "# πŸ“¦ Changelog \n[![conventional commits](https://img.shields.io/badge/conventional%20commits-1.0.0-yellow.svg)](https://conventionalcommits.org)\n[![semantic versioning](https://img.shields.io/badge/semantic%20versioning-2.0.0-green.svg)](https://semver.org)\n> All notable changes to this project will be documented in this file"
}
],
[
"@semantic-release/exec",
{
"prepareCmd": "./scripts/prepareCMD.sh ${nextRelease.version}",
"publishCmd": "echo Publishing ${nextRelease.version}"
}
],
[
"@semantic-release/npm",
{
"npmPublish": false
}
],
[
"@semantic-release/github",
{
"assets": [
{
"path": "dist/*.tar.gz",
"label": "Distribution"
}
]
}
],
[
"@semantic-release/git",
{
"assets": [
"package.json",
"LICENSE*",
"CHANGELOG.md"
],
"message": "chore(${nextRelease.type}): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
]
]
}
Loading

0 comments on commit e57192d

Please sign in to comment.