feat(ci): Add Gitea workflows for build and release.
This commit is contained in:
		
							
								
								
									
										66
									
								
								.gitea/workflows/default_nottags.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										66
									
								
								.gitea/workflows/default_nottags.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,66 @@ | ||||
| name: Default (not tags) | ||||
|  | ||||
| on: | ||||
|   push: | ||||
|     tags-ignore: | ||||
|       - '**' | ||||
|  | ||||
| env: | ||||
|   IMAGE: code.foss.global/hosttoday/ht-docker-node:npmci | ||||
|   NPMCI_COMPUTED_REPOURL: https://${{gitea.repository_owner}}:${{secrets.GITEA_TOKEN}}@/${{gitea.repository}}.git | ||||
|   NPMCI_TOKEN_NPM: ${{secrets.NPMCI_TOKEN_NPM}} | ||||
|   NPMCI_TOKEN_NPM2: ${{secrets.NPMCI_TOKEN_NPM2}} | ||||
|   NPMCI_GIT_GITHUBTOKEN: ${{secrets.NPMCI_GIT_GITHUBTOKEN}} | ||||
|   NPMCI_URL_CLOUDLY: ${{secrets.NPMCI_URL_CLOUDLY}} | ||||
|  | ||||
| jobs: | ||||
|   security: | ||||
|     runs-on: ubuntu-latest | ||||
|     continue-on-error: true | ||||
|     container: | ||||
|       image: ${{ env.IMAGE }} | ||||
|  | ||||
|     steps: | ||||
|       - uses: actions/checkout@v3 | ||||
|  | ||||
|       - name: Install pnpm and npmci | ||||
|         run: | | ||||
|           pnpm install -g pnpm | ||||
|           pnpm install -g @ship.zone/npmci | ||||
|  | ||||
|       - name: Run npm prepare | ||||
|         run: npmci npm prepare | ||||
|  | ||||
|       - name: Audit production dependencies | ||||
|         run: | | ||||
|           npmci command npm config set registry https://registry.npmjs.org | ||||
|           npmci command pnpm audit --audit-level=high --prod | ||||
|         continue-on-error: true | ||||
|  | ||||
|       - name: Audit development dependencies | ||||
|         run: | | ||||
|           npmci command npm config set registry https://registry.npmjs.org | ||||
|           npmci command pnpm audit --audit-level=high --dev | ||||
|         continue-on-error: true | ||||
|  | ||||
|   test: | ||||
|     if: ${{ always() }} | ||||
|     needs: security | ||||
|     runs-on: ubuntu-latest | ||||
|     container: | ||||
|       image: ${{ env.IMAGE }} | ||||
|  | ||||
|     steps: | ||||
|       - uses: actions/checkout@v3 | ||||
|  | ||||
|       - name: Test stable | ||||
|         run: | | ||||
|           npmci node install stable | ||||
|           npmci npm install | ||||
|           npmci npm test | ||||
|  | ||||
|       - name: Test build | ||||
|         run: | | ||||
|           npmci node install stable | ||||
|           npmci npm install | ||||
|           npmci npm build | ||||
							
								
								
									
										124
									
								
								.gitea/workflows/default_tags.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										124
									
								
								.gitea/workflows/default_tags.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,124 @@ | ||||
| name: Default (tags) | ||||
|  | ||||
| on: | ||||
|   push: | ||||
|     tags: | ||||
|       - '*' | ||||
|  | ||||
| env: | ||||
|   IMAGE: code.foss.global/hosttoday/ht-docker-node:npmci | ||||
|   NPMCI_COMPUTED_REPOURL: https://${{gitea.repository_owner}}:${{secrets.GITEA_TOKEN}}@/${{gitea.repository}}.git | ||||
|   NPMCI_TOKEN_NPM: ${{secrets.NPMCI_TOKEN_NPM}} | ||||
|   NPMCI_TOKEN_NPM2: ${{secrets.NPMCI_TOKEN_NPM2}} | ||||
|   NPMCI_GIT_GITHUBTOKEN: ${{secrets.NPMCI_GIT_GITHUBTOKEN}} | ||||
|   NPMCI_URL_CLOUDLY: ${{secrets.NPMCI_URL_CLOUDLY}} | ||||
|  | ||||
| jobs: | ||||
|   security: | ||||
|     runs-on: ubuntu-latest | ||||
|     continue-on-error: true | ||||
|     container: | ||||
|       image: ${{ env.IMAGE }} | ||||
|  | ||||
|     steps: | ||||
|       - uses: actions/checkout@v3 | ||||
|  | ||||
|       - name: Prepare | ||||
|         run: | | ||||
|           pnpm install -g pnpm | ||||
|           pnpm install -g @ship.zone/npmci | ||||
|           npmci npm prepare | ||||
|  | ||||
|       - name: Audit production dependencies | ||||
|         run: | | ||||
|           npmci command npm config set registry https://registry.npmjs.org | ||||
|           npmci command pnpm audit --audit-level=high --prod | ||||
|         continue-on-error: true | ||||
|  | ||||
|       - name: Audit development dependencies | ||||
|         run: | | ||||
|           npmci command npm config set registry https://registry.npmjs.org | ||||
|           npmci command pnpm audit --audit-level=high --dev | ||||
|         continue-on-error: true | ||||
|  | ||||
|   test: | ||||
|     if: ${{ always() }} | ||||
|     needs: security | ||||
|     runs-on: ubuntu-latest | ||||
|     container: | ||||
|       image: ${{ env.IMAGE }} | ||||
|  | ||||
|     steps: | ||||
|       - uses: actions/checkout@v3 | ||||
|  | ||||
|       - name: Prepare | ||||
|         run: | | ||||
|           pnpm install -g pnpm | ||||
|           pnpm install -g @ship.zone/npmci | ||||
|           npmci npm prepare | ||||
|  | ||||
|       - name: Test stable | ||||
|         run: | | ||||
|           npmci node install stable | ||||
|           npmci npm install | ||||
|           npmci npm test | ||||
|  | ||||
|       - name: Test build | ||||
|         run: | | ||||
|           npmci node install stable | ||||
|           npmci npm install | ||||
|           npmci npm build | ||||
|  | ||||
|   release: | ||||
|     needs: test | ||||
|     if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | ||||
|     runs-on: ubuntu-latest | ||||
|     container: | ||||
|       image: ${{ env.IMAGE }} | ||||
|  | ||||
|     steps: | ||||
|       - uses: actions/checkout@v3 | ||||
|  | ||||
|       - name: Prepare | ||||
|         run: | | ||||
|           pnpm install -g pnpm | ||||
|           pnpm install -g @ship.zone/npmci | ||||
|           npmci npm prepare | ||||
|  | ||||
|       - name: Release | ||||
|         run: | | ||||
|           npmci node install stable | ||||
|           npmci npm publish | ||||
|  | ||||
|   metadata: | ||||
|     needs: test | ||||
|     if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | ||||
|     runs-on: ubuntu-latest | ||||
|     container: | ||||
|       image: ${{ env.IMAGE }} | ||||
|     continue-on-error: true | ||||
|  | ||||
|     steps: | ||||
|       - uses: actions/checkout@v3 | ||||
|  | ||||
|       - name: Prepare | ||||
|         run: | | ||||
|           pnpm install -g pnpm | ||||
|           pnpm install -g @ship.zone/npmci | ||||
|           npmci npm prepare | ||||
|  | ||||
|       - name: Code quality | ||||
|         run: | | ||||
|           npmci command npm install -g typescript | ||||
|           npmci npm install | ||||
|  | ||||
|       - name: Trigger | ||||
|         run: npmci trigger | ||||
|  | ||||
|       - name: Build docs and upload artifacts | ||||
|         run: | | ||||
|           npmci node install stable | ||||
|           npmci npm install | ||||
|           pnpm install -g @git.zone/tsdoc | ||||
|           npmci command tsdoc | ||||
|         continue-on-error: true | ||||
| @@ -1,5 +1,13 @@ | ||||
| # Changelog | ||||
|  | ||||
| ## 2024-10-27 - 1.3.0 - feat(ci) | ||||
| Add Gitea workflows for build and release. | ||||
|  | ||||
| - Added .gitea/workflows/default_nottags.yaml for non-tag events. | ||||
| - Added .gitea/workflows/default_tags.yaml for tag-based events. | ||||
| - Updated build scripts in package.json to use pnpm. | ||||
| - Refactored imports and exports in TypeScript source for better modularity. | ||||
|  | ||||
| ## 2024-06-24 - 1.2.49 - fix(core) | ||||
| Minor maintenance updates with version bump | ||||
|  | ||||
|   | ||||
							
								
								
									
										16
									
								
								package.json
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								package.json
									
									
									
									
									
								
							| @@ -11,9 +11,9 @@ | ||||
|     "tsrun": "./cli.js" | ||||
|   }, | ||||
|   "scripts": { | ||||
|     "test": "(tsbuild && node ./cli.js test/test.js sayhello)", | ||||
|     "test": "(pnpm run build && node ./cli.js test/test.js sayhello)", | ||||
|     "format": "(gitzone format)", | ||||
|     "build": "(tsbuild)", | ||||
|     "build": "(tsbuild --web --allowimplicitany)", | ||||
|     "buildDocs": "tsdoc" | ||||
|   }, | ||||
|   "devDependencies": { | ||||
| @@ -43,5 +43,13 @@ | ||||
|   ], | ||||
|   "browserslist": [ | ||||
|     "last 1 chrome versions" | ||||
|   ] | ||||
| } | ||||
|   ], | ||||
|   "repository": { | ||||
|     "type": "git", | ||||
|     "url": "git+https://gitlab.com/gitzone/tsrun.git" | ||||
|   }, | ||||
|   "bugs": { | ||||
|     "url": "https://gitlab.com/gitzone/tsrun/issues" | ||||
|   }, | ||||
|   "homepage": "https://gitlab.com/gitzone/tsrun#readme" | ||||
| } | ||||
							
								
								
									
										1553
									
								
								pnpm-lock.yaml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										1553
									
								
								pnpm-lock.yaml
									
									
									
										generated
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										37
									
								
								readme.md
									
									
									
									
									
								
							
							
						
						
									
										37
									
								
								readme.md
									
									
									
									
									
								
							| @@ -1,26 +1,28 @@ | ||||
| # @gitzone/tsrun | ||||
|  | ||||
| run typescript programs efficiently | ||||
|  | ||||
| ## Availabililty and Links | ||||
| * [npmjs.org (npm package)](https://www.npmjs.com/package/@gitzone/tsrun) | ||||
| * [gitlab.com (source)](https://gitlab.com/gitzone/tsrun) | ||||
| * [github.com (source mirror)](https://github.com/gitzone/tsrun) | ||||
| * [docs (typedoc)](https://gitzone.gitlab.io/tsrun/) | ||||
|  | ||||
| - [npmjs.org (npm package)](https://www.npmjs.com/package/@gitzone/tsrun) | ||||
| - [gitlab.com (source)](https://gitlab.com/gitzone/tsrun) | ||||
| - [github.com (source mirror)](https://github.com/gitzone/tsrun) | ||||
| - [docs (typedoc)](https://gitzone.gitlab.io/tsrun/) | ||||
|  | ||||
| ## Status for master | ||||
|  | ||||
| Status Category | Status Badge | ||||
| -- | -- | ||||
| GitLab Pipelines | [](https://lossless.cloud) | ||||
| GitLab Pipline Test Coverage | [](https://lossless.cloud) | ||||
| npm | [](https://lossless.cloud) | ||||
| Snyk | [](https://lossless.cloud) | ||||
| TypeScript Support | [](https://lossless.cloud) | ||||
| node Support | [](https://nodejs.org/dist/latest-v10.x/docs/api/) | ||||
| Code Style | [](https://lossless.cloud) | ||||
| PackagePhobia (total standalone install weight) | [](https://lossless.cloud) | ||||
| PackagePhobia (package size on registry) | [](https://lossless.cloud) | ||||
| BundlePhobia (total size when bundled) | [](https://lossless.cloud) | ||||
| | Status Category                                 | Status Badge                                                                                                      | | ||||
| | ----------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | | ||||
| | GitLab Pipelines                                | [](https://lossless.cloud)         | | ||||
| | GitLab Pipline Test Coverage                    | [](https://lossless.cloud)         | | ||||
| | npm                                             | [](https://lossless.cloud)                    | | ||||
| | Snyk                                            | [](https://lossless.cloud)                         | | ||||
| | TypeScript Support                              | [](https://lossless.cloud)        | | ||||
| | node Support                                    | [](https://nodejs.org/dist/latest-v10.x/docs/api/) | | ||||
| | Code Style                                      | [](https://lossless.cloud)                           | | ||||
| | PackagePhobia (total standalone install weight) | [](https://lossless.cloud)               | | ||||
| | PackagePhobia (package size on registry)        | [](https://lossless.cloud)               | | ||||
| | BundlePhobia (total size when bundled)          | [](https://lossless.cloud)                  | | ||||
|  | ||||
| ## Usage | ||||
|  | ||||
| @@ -43,5 +45,6 @@ We are always happy for code contributions. If you are not the code contributing | ||||
| For further information read the linked docs at the top of this readme. | ||||
|  | ||||
| ## Legal | ||||
|  | ||||
| > MIT licensed | **©** [Task Venture Capital GmbH](https://task.vc) | ||||
| | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy) | ||||
| > | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy) | ||||
|   | ||||
| @@ -3,6 +3,6 @@ | ||||
|  */ | ||||
| export const commitinfo = { | ||||
|   name: '@git.zone/tsrun', | ||||
|   version: '1.2.49', | ||||
|   version: '1.3.0', | ||||
|   description: 'run typescript programs efficiently' | ||||
| } | ||||
|   | ||||
| @@ -37,6 +37,6 @@ export const runCli = async (pathArg?: string) => { | ||||
|             return prevArg + ' ' + currentArg; | ||||
|           }) | ||||
|         : '' | ||||
|     }` | ||||
|     }`, | ||||
|   ); | ||||
| }; | ||||
|   | ||||
| @@ -1,3 +1,4 @@ | ||||
| import * as paths from './paths.js'; | ||||
| import * as plugins from './plugins.js'; | ||||
| import type { CompilerOptions } from 'typescript'; | ||||
|  | ||||
| @@ -12,6 +13,8 @@ const defaultTsNodeOptions: plugins.tsNode.CreateOptions = { | ||||
|     moduleResolution: <any>'nodenext', | ||||
|     module: <any>'nodenext', | ||||
|     verbatimModuleSyntax: true, | ||||
|     paths: plugins.smartfile.fs.toObjectSync(plugins.path.join(paths.cwd, 'tsconfig.json')) | ||||
|       ?.compilerOptions?.paths, | ||||
|   } as CompilerOptions, | ||||
|   esm: true, | ||||
|   skipIgnore: true, | ||||
| @@ -19,5 +22,5 @@ const defaultTsNodeOptions: plugins.tsNode.CreateOptions = { | ||||
| }; | ||||
|  | ||||
| export const { resolve, load, getFormat, transformSource } = plugins.tsNode.createEsmHooks( | ||||
|   plugins.tsNode.register(defaultTsNodeOptions) | ||||
|   plugins.tsNode.register(defaultTsNodeOptions), | ||||
| ) as any; | ||||
|   | ||||
							
								
								
									
										1
									
								
								ts/paths.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								ts/paths.ts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1 @@ | ||||
| export const cwd = process.cwd(); | ||||
| @@ -5,9 +5,10 @@ import * as url from 'url'; | ||||
| export { path, url }; | ||||
|  | ||||
| // @pushrocks scope | ||||
| import * as smartfile from '@push.rocks/smartfile'; | ||||
| import * as smartshell from '@push.rocks/smartshell'; | ||||
|  | ||||
| export { smartshell }; | ||||
| export { smartfile, smartshell }; | ||||
|  | ||||
| // third party scope | ||||
| import * as tsNode from 'ts-node'; | ||||
|   | ||||
| @@ -3,7 +3,12 @@ | ||||
|     "experimentalDecorators": true, | ||||
|     "useDefineForClassFields": false, | ||||
|     "target": "ES2022", | ||||
|     "module": "ES2022", | ||||
|     "moduleResolution": "nodenext" | ||||
|   } | ||||
|     "module": "NodeNext", | ||||
|     "moduleResolution": "NodeNext", | ||||
|     "esModuleInterop": true, | ||||
|     "verbatimModuleSyntax": true | ||||
|   }, | ||||
|   "exclude": [ | ||||
|     "dist_*/**/*.d.ts" | ||||
|   ] | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user