Skip to content

Commit

Permalink
Merge pull request #7 from BetterCorp/develop
Browse files Browse the repository at this point in the history
Build fixes, docs updates, and added new platforms in prep.
  • Loading branch information
mrinc authored Sep 18, 2022
2 parents ba9230a + 8a4d267 commit ed7abfd
Show file tree
Hide file tree
Showing 88 changed files with 144 additions and 42 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
- "**"

jobs:
build-framework:
build-framework-nodejs:
runs-on: ubuntu-latest

strategy:
Expand All @@ -26,26 +26,32 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
cache-dependency-path: nodejs/package-lock.json

- run: npm i -g typescript ts-node
working-directory: ./nodejs
- run: tsc -v ; ts-node -v
working-directory: ./nodejs
- run: npm ci
working-directory: ./nodejs
- run: npm run build
working-directory: ./nodejs
- run: npm run test
working-directory: ./nodejs

- name: Test Report ${{ matrix.node-version }}
uses: dorny/[email protected]
with:
name: Tests
path: junit.json
path: nodejs/junit.json
reporter: mocha-json

- name: Upload coverage reports to Codecov
if: contains(matrix.node-version, '18.x')
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: coverage
directory: nodejs/coverage

- name: cleanup
if: always()
Expand All @@ -70,6 +76,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
cache-dependency-path: documentation/package-lock.json

- run: npm ci
working-directory: documentation/
Expand Down
32 changes: 22 additions & 10 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- "develop"

jobs:
build_and_publish_ea:
build_and_publish_ea_nodejs:
runs-on: ubuntu-latest

strategy:
Expand All @@ -31,10 +31,14 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
cache-dependency-path: nodejs/package-lock.json

- run: npm i -g typescript ts-node
working-directory: ./nodejs
- run: tsc -v ; ts-node -v
working-directory: ./nodejs
- run: npm ci
working-directory: ./nodejs

- name: semver
id: semver
Expand All @@ -50,6 +54,7 @@ jobs:
namespace: ""

- run: rm -f ~/.npmrc ; rm -f ./.npmrc ; echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM2_TOKEN_PUB }}" > ./.npmrc
working-directory: ./nodejs
- run: |
git config user.name "${{ secrets.NPM_NAME }}";
git config user.email "${{ secrets.NPM_EMAIL }}";
Expand All @@ -60,41 +65,46 @@ jobs:
echo "Setting version too: ${{ steps.semver.outputs.version }}";
- run: npm version ${{ steps.semver.outputs.version }}
working-directory: ./nodejs
- run: npm run build
working-directory: ./nodejs
- run: npm run test
working-directory: ./nodejs

- name: Test Report ${{ matrix.node-version }}
uses: dorny/[email protected]
with:
name: Tests
path: junit.json
path: nodejs/junit.json
reporter: mocha-json

- name: Upload coverage reports to Codecov
if: contains(matrix.node-version, '18.x')
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: coverage
directory: nodejs/coverage

- run: npm publish --tag ea
working-directory: ./nodejs
if: contains(matrix.node-version, '18.x')

- run: npm pack
working-directory: ./nodejs
if: contains(matrix.node-version, '18.x')

- uses: actions/upload-artifact@v2
if: contains(matrix.node-version, '18.x')
with:
name: published-package
path: ./*.tgz
path: ./nodejs/*.tgz

- name: cleanup
if: always()
run: rm -f ~/.npmrc ; rm -f ./.npmrc;

docker_build_ea:
needs: [build_and_publish_ea, docs_build_ea]
docker_build_ea_nodejs:
needs: [build_and_publish_ea_nodejs, docs_build_ea]
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -103,6 +113,7 @@ jobs:
- uses: actions/download-artifact@v2
with:
name: published-package
path: ./nodejs

- name: Set up QEMU
uses: docker/setup-qemu-action@master
Expand All @@ -124,17 +135,17 @@ jobs:
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: ./Dockerfile
context: ./nodejs/
file: ./nodejs/Dockerfile
platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x
push: true
tags: |
betterweb/service-base:ea-latest
betterweb/service-base:${{ needs.build_and_publish_ea.outputs.version }}
betterweb/service-base:${{ needs.build_and_publish_ea_nodejs.outputs.version }}
docs_build_ea:
runs-on: ubuntu-latest
needs: [build_and_publish_ea]
needs: [build_and_publish_ea_nodejs]

strategy:
matrix:
Expand All @@ -152,6 +163,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
cache-dependency-path: documentation/package-lock.json

- run: npm ci
working-directory: documentation/
Expand Down
32 changes: 22 additions & 10 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- "master"

jobs:
build_and_publish_rc:
build_and_publish_rc_nodejs:
runs-on: ubuntu-latest

strategy:
Expand All @@ -31,10 +31,14 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
cache-dependency-path: nodejs/package-lock.json

- run: npm i -g typescript ts-node
working-directory: ./nodejs
- run: tsc -v ; ts-node -v
working-directory: ./nodejs
- run: npm ci
working-directory: ./nodejs

- name: semver
id: semver
Expand All @@ -50,6 +54,7 @@ jobs:
namespace: ""

- run: rm -f ~/.npmrc ; rm -f ./.npmrc ; echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM2_TOKEN_PUB }}" > ./.npmrc
working-directory: ./nodejs
- run: |
git config user.name "${{ secrets.NPM_NAME }}";
git config user.email "${{ secrets.NPM_EMAIL }}";
Expand All @@ -60,41 +65,46 @@ jobs:
echo "Setting version too: ${{ steps.semver.outputs.version }}";
- run: npm version ${{ steps.semver.outputs.version }}
working-directory: ./nodejs
- run: npm run build
working-directory: ./nodejs
- run: npm run test
working-directory: ./nodejs

- name: Test Report ${{ matrix.node-version }}
uses: dorny/[email protected]
with:
name: Tests
path: junit.json
path: nodejs/junit.json
reporter: mocha-json

- name: Upload coverage reports to Codecov
if: contains(matrix.node-version, '18.x')
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: coverage
directory: nodejs/coverage

- run: npm publish --tag rc
working-directory: ./nodejs
if: contains(matrix.node-version, '18.x')

- run: npm pack
working-directory: ./nodejs
if: contains(matrix.node-version, '18.x')

- uses: actions/upload-artifact@v2
if: contains(matrix.node-version, '18.x')
with:
name: published-package
path: bettercorp-service-base-*.tgz
path: nodejs/bettercorp-service-base-*.tgz

- name: cleanup
if: always()
run: rm -f ~/.npmrc ; rm -f ./.npmrc;

docker_build_rc:
needs: [build_and_publish_rc, docs_build_rc]
docker_build_rc_nodejs:
needs: [build_and_publish_rc_nodejs, docs_build_rc]
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -103,6 +113,7 @@ jobs:
- uses: actions/download-artifact@v2
with:
name: published-package
path: ./nodejs

- name: Set up QEMU
uses: docker/setup-qemu-action@master
Expand All @@ -124,17 +135,17 @@ jobs:
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: ./Dockerfile
context: ./nodejs/
file: ./nodejs/Dockerfile
platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x
push: true
tags: |
betterweb/service-base:rc-latest
betterweb/service-base:${{ needs.build_and_publish_rc.outputs.version }}
betterweb/service-base:${{ needs.build_and_publish_rc_nodejs.outputs.version }}
docs_build_rc:
runs-on: ubuntu-latest
needs: [build_and_publish_rc]
needs: [build_and_publish_rc_nodejs]

strategy:
matrix:
Expand All @@ -152,6 +163,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
cache-dependency-path: documentation/package-lock.json

- run: npm ci
working-directory: documentation/
Expand Down
Loading

0 comments on commit ed7abfd

Please sign in to comment.