-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from cristopher1/development
v1.0.0
- Loading branch information
Showing
5 changed files
with
196 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
# Workflow to use continuos delivery | ||
|
||
name: CD | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
test_and_build: | ||
name: Test and build the distributable generator-koa2-simple-api-generator | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20.x | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: audit | ||
run: npm audit | ||
|
||
- name: run quality check | ||
run: npm run quality-check | ||
|
||
- name: build the dist folder | ||
run: npm run build | ||
|
||
- name: save artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: distributable-generator-koa2-simple-api-generator | ||
path: | | ||
dist | ||
LICENSE | ||
README.md | ||
package.json | ||
retention-days: 1 | ||
|
||
release: | ||
name: Create new release | ||
runs-on: ubuntu-latest | ||
needs: test_and_build | ||
permissions: | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20.x | ||
|
||
- name: create a new release | ||
uses: actions/create-release@v1.1.4 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref_name }} | ||
release_name: ${{ github.ref_name }} | ||
body_path: RELEASE_NOTES.md | ||
|
||
publish: | ||
name: publish generator-koa2-simple-api-generator package | ||
runs-on: ubuntu-latest | ||
needs: release | ||
environment: publish | ||
steps: | ||
- name: download generator-koa2-simple-api-generator distribuible | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: distributable-generator-koa2-simple-api-generator | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20.x | ||
|
||
- name: publish generator-koa2-simple-api-generator en npm | ||
uses: JS-DevTools/npm-publish@v3 | ||
with: | ||
token: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
# Workflow to use continuous integration | ||
|
||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- development | ||
- main | ||
pull_request: | ||
branches: | ||
- development | ||
|
||
jobs: | ||
test_and_build: | ||
name: Test the source code and build the generator-koa2-simple-api-generator generator | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20.x | ||
|
||
- name: install dependencies using package-lock.json | ||
run: npm ci | ||
|
||
- name: audit | ||
run: npm audit | ||
|
||
- name: run linter, formatter and unit tests | ||
run: | | ||
npm run lint | ||
npm run format | ||
npm run test | ||
- name: build the dist folder | ||
run: npm run build | ||
|
||
- name: save artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: dist-generator-koa2-simple-api-generator | ||
path: | | ||
dist | ||
LICENSE | ||
README.md | ||
package.json | ||
retention-days: 1 | ||
|
||
create_generator: | ||
name: Test a generator created by generator-koa2-simple-api-generator generator | ||
needs: test_and_build | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: ['>=18.17.0', '20.x'] | ||
steps: | ||
- name: download dist generator-koa2-simple-api-generator generator | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: dist-generator-koa2-simple-api-generator | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: print node-version | ||
run: echo ${{ matrix.node-version }} | ||
|
||
- name: install yeoman | ||
run: npm install -g yo | ||
|
||
- name: install dependencies, it does not use the package-lock.json file | ||
run: npm install | ||
|
||
- name: link the generator | ||
run: npm link | ||
|
||
- name: create a new folder | ||
working-directory: ../ | ||
run: mkdir -p generator_test | ||
|
||
- name: create a new generator | ||
working-directory: ../generator_test | ||
run: yo koa2-simple-api-generator new_api postgresql --runGitInit --runPackageScripts --useDocker --nodeVersion=21 --projectFolderName=api --useDockerCompose --databaseName=postgresql | ||
|
||
- name: audit | ||
run: npm audit | ||
|
||
- name: run linter and formatter | ||
working-directory: ../generator_test/api | ||
run: | | ||
npm run lint | ||
npm run format |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters