From 719a21d82c334ce9c9d8a6c3134f0bd96cb8e4c3 Mon Sep 17 00:00:00 2001 From: Michael Haufe Date: Fri, 5 Jun 2020 15:12:45 -0500 Subject: [PATCH] Updated CI/CD configuration (#130) --- .github/workflows/build-release.yml | 79 +++++++++++++++++++++++++++++ .github/workflows/build.yml | 24 ++------- .github/workflows/release.yml | 44 ---------------- .github/workflows/validation.yml | 46 ----------------- CHANGELOG.md | 4 ++ package-lock.json | 2 +- package.json | 2 +- 7 files changed, 88 insertions(+), 113 deletions(-) create mode 100644 .github/workflows/build-release.yml delete mode 100644 .github/workflows/release.yml delete mode 100644 .github/workflows/validation.yml diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml new file mode 100644 index 0000000..d5a6e3d --- /dev/null +++ b/.github/workflows/build-release.yml @@ -0,0 +1,79 @@ +# Reference: +name: Build/Release + +on: + release: + types: [created] + +jobs: + build: + runs-on: windows-latest + + strategy: + matrix: + node-version: [14.x] + + steps: + - uses: actions/checkout@v2 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + + - name: Cache Node.js modules + uses: actions/cache@v1 + with: + path: "%AppData%\npm-cache" # npm cache files are stored under the AppData folder on Windows + key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.OS }}-node- + ${{ runner.OS }}- + + - name: npm install, build, and test + run: | + npm install + npm run build-nofix + npm test + env: + CI: true + + - name: npm pack + run: npm pack + working-directory: ./ + + - name: Rename package + run: mv *.tgz final-hill-decorator-contracts.tgz + + - name: Upload package + uses: actions/upload-artifact@v1 + with: + name: package + path: final-hill-decorator-contracts.tgz + release: + runs-on: windows-latest + + strategy: + matrix: + node-version: [14.x] + + steps: + - uses: actions/checkout@v2 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + registry-url: 'https://registry.npmjs.org' + + - name: Download package + uses: actions/download-artifact@v1 + with: + name: package + + - name: configure npmrc + run: npm config set '//registry.npmjs.org/:_authToken' "${NODE_AUTH_TOKEN}" + + - run: npm publish ./package/final-hill-decorator-contracts.tgz + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 41cdab4..3a72209 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,26 +1,21 @@ # Reference: name: Build -# Controls when the action will run. Triggers the workflow on push or pull request -# events but only for the master branch on: + pull_request: + branches: [ master ] push: branches: [ master ] -# A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains a single job called "build" - build: - # The type of runner that the job will run on + validate: runs-on: windows-latest strategy: matrix: node-version: [14.x] - # Steps represent a sequence of tasks that will be executed as part of the job steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v2 - name: Use Node.js ${{ matrix.node-version }} @@ -44,16 +39,3 @@ jobs: npm test env: CI: true - - - name: npm pack - run: npm pack - working-directory: ./ - - - name: Rename package - run: mv *.tgz final-hill-decorator-contracts.tgz - - - name: Upload package - uses: actions/upload-artifact@v1 - with: - name: package - path: final-hill-decorator-contracts.tgz \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 3fd6e1d..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,44 +0,0 @@ -# Reference: -name: Release - -# Controls when the action will run. Triggers the workflow on push or pull request -# events but only for the master branch -on: - release: - types: [created] - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a single job called "release" - release: - # The type of runner that the job will run on - runs-on: windows-latest - - strategy: - matrix: - node-version: [14.x] - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 - - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - registry-url: 'https://registry.npmjs.org' - - - name: Download package - uses: actions/download-artifact@v1 - with: - name: package - - - run: npm install - - - name: configure npmrc - run: npm config set '//registry.npmjs.org/:_authToken' "${NODE_AUTH_TOKEN}" - - - run: npm publish ./package/final-hill-decorator-contracts.tgz - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml deleted file mode 100644 index 9f03987..0000000 --- a/.github/workflows/validation.yml +++ /dev/null @@ -1,46 +0,0 @@ -# Reference: -name: Validation - -# Controls when the action will run. Triggers the workflow on push or pull request -# events but only for the master branch -on: - pull_request: - branches: [ master ] - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a single job called "validate" - validate: - # The type of runner that the job will run on - runs-on: windows-latest - - strategy: - matrix: - node-version: [14.x] - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 - - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - - name: Cache Node.js modules - uses: actions/cache@v1 - with: - path: "%AppData%\npm-cache" # npm cache files are stored under the AppData folder on Windows - key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.OS }}-node- - ${{ runner.OS }}- - - - name: npm install, build, and test - run: | - npm install - npm run build-nofix - npm test - env: - CI: true diff --git a/CHANGELOG.md b/CHANGELOG.md index cec695d..3ddb77a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## v0.17.1 + +* Updated CI/CD configuration + ## v0.17.0 * Migrated repository from Azure Devops to GitHub diff --git a/package-lock.json b/package-lock.json index 9d2971c..68d1e93 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@final-hill/decorator-contracts", - "version": "0.17.0", + "version": "0.17.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index ecd9dc2..d4d9a82 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@final-hill/decorator-contracts", - "version": "0.17.0", + "version": "0.17.1", "description": "Code Contracts for TypeScript and ECMAScript classes", "main": "dist/index.js", "scripts": {