Skip to content

Commit

Permalink
feat: upgrade to v1018 of Web SDK (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
reey authored Sep 15, 2023
1 parent 9c3af60 commit c1be07b
Show file tree
Hide file tree
Showing 30 changed files with 47,447 additions and 10,941 deletions.
16 changes: 15 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,20 @@
},
"rules": {
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
"@typescript-eslint/ban-ts-comment": "warn"
"@typescript-eslint/ban-ts-comment": "warn",
"@typescript-eslint/no-unused-vars": [
"error",
{
"vars": "all",
"varsIgnorePattern": "^_",
"args": "after-used",
"argsIgnorePattern": "^_",
"ignoreRestSiblings": false
}
],
"sort-imports": "off",
"quotes": ["error", "single", { "avoidEscape": true, "allowTemplateLiterals": true }],
"no-console": "warn",
"@typescript-eslint/no-var-requires": "error"
}
}
91 changes: 10 additions & 81 deletions .github/workflows/main-ci.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
name: Main CI

on:
push:
branches: [main]
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
pull_request:
branches: [main]

env:
NODE_VERSION: '12'
NODE_VERSION: '16'

# concurrency:
# group: ${{ github.ref }}
Expand All @@ -24,99 +20,32 @@ jobs:
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: Check out Git repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'

- name: Set C8Y_VERSION env variable
run: echo "C8Y_VERSION=$(node -p -e "require('./package.json').dependencies['@c8y/ngx-components']")" >> $GITHUB_ENV

- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install Node.js dependencies
run: npm install
run: npm ci

- name: 🕵️‍♂️ Lint
run: npm run lint --if-present
# - name: 🕵️‍♂️ Lint
# run: npm run lint --if-present

- name: 🧪 Test
run: npm test --if-present

- name: 🚧 Build
run: npm run build:ci --if-present
run: npm run build:ci

- name: Upload Subtenant Artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: subtenant-management-${{ env.C8Y_VERSION }}-${{ github.event.number }}-${{ github.run_id }}
path: dist/apps/subtenant-management/

- name: Upload Administration Artifact
uses: actions/upload-artifact@v2
with:
name: administration-${{ env.C8Y_VERSION }}-${{ github.event.number }}-${{ github.run_id }}
path: dist/apps/administration/

- name: 🎁 Zip Subtenant Management
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
run: |
cd dist/apps/subtenant-management
zip -r -q ../../../subtenant-management.zip *
cd ../../..
path: dist/apps/sag-pkg-subtenant-management/

- name: 🎁 Zip Administration
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
run: |
cd dist/apps/administration
zip -r -q ../../../administration.zip *
cd ../../..
- name: Create Release
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ env.RELEASE_VERSION }} based on ${{ env.C8Y_VERSION }}
draft: false
prerelease: true

- name: Upload Release Asset Subtenant Management
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
id: upload-release-asset-subtenant
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./subtenant-management.zip
asset_name: subtenant-management-${{ env.C8Y_VERSION }}-${{ env.RELEASE_VERSION }}.zip
asset_content_type: application/zip

- name: Upload Release Asset Administration
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
id: upload-release-asset-admin
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./administration.zip
asset_name: administration-${{ env.C8Y_VERSION }}-${{ env.RELEASE_VERSION }}.zip
asset_content_type: application/zip
129 changes: 129 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
name: Release
on:
push:
branches:
- main
- next
- beta
- '*.x'
- '*.*.x'

permissions:
contents: write
issues: write
pull-requests: write

jobs:
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 8
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'npm'

- name: Install dependencies
run: npm ci

# - name: Linting
# run: npm run lint

- name: Build
run: npm run build:ci

- name: Zip build
run: |
cd dist/apps/sag-pkg-subtenant-management
zip -r -q ../../build.zip *
cd ../../..
rm -r dist/apps
- name: Upload build artifact
uses: actions/upload-artifact@v3
with:
name: build
if-no-files-found: error
retention-days: 5
path: |
dist/build.zip
release:
name: Release
runs-on: ubuntu-latest
needs: [build]
timeout-minutes: 8
outputs:
initial-version: ${{ steps.save-initial-version.outputs.version }}
version: ${{ steps.save-version.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 'lts/*'

- name: Save initial Version
id: save-initial-version
run: echo "version=$(cat package.json | jq '.version' | xargs)" >> $GITHUB_OUTPUT

- name: Install dependencies
run: npm ci

- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release

- name: Save Version
id: save-version
run: echo "version=$(cat package.json | jq '.version' | xargs)" >> $GITHUB_OUTPUT

release-assets:
needs: [release]
if: ${{ needs.release.outputs.initial-version != needs.release.outputs.version }}
name: Release assets
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: v${{ needs.release.outputs.version }}

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build:ci

- name: Zip build
run: |
cd dist/apps/sag-pkg-subtenant-management
zip -r -q ../../../subtenant-management-${{ needs.release.outputs.version }}.zip *
cd ../../..
rm -r dist/apps
- name: Release
uses: softprops/action-gh-release@v1
with:
files: subtenant-management-${{ needs.release.outputs.version }}.zip
tag_name: v${{ needs.release.outputs.version }}
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
registry=https://registry.npmjs.org/
@c8y:registry=https://download.cumulocity.com/npm/
41 changes: 41 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"branches": [
"+([0-9])?(.{+([0-9]),x}).x",
"main",
"next",
"next-major",
{ "name": "beta", "prerelease": true },
{ "name": "alpha", "prerelease": true }
],
"tagFormat": "v${version}",
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
[
"@semantic-release/npm",
{
"npmPublish": false
}
],
[
"@semantic-release/git",
{
"assets": [
"CHANGELOG.md",
"package.json",
"package-lock.json",
"npm-shrinkwrap.json"
],
"message": "ci(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
],
[
"@semantic-release/github",
{
"assets": []
}
]
],
"preset": "angular"
}
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
# Cumulocity Subtenant Management
Tool for managing subtenants from a c8y management or enterprise tenant

## Applications

The subtenant management functionality is available in two different flavours.
You can get it as an extension of the default Cumulocity `Administration` app, or as a seperate `Subtenant Management` app.

## Installation

1. Download the [latest release of the Subtenant Management App](https://github.com/SoftwareAG/cumulocity-subtenant-management/releases/latest)
Expand Down
File renamed without changes.
44 changes: 0 additions & 44 deletions apps/administration/app.module.ts

This file was deleted.

18 changes: 0 additions & 18 deletions apps/administration/index.ts

This file was deleted.

Loading

0 comments on commit c1be07b

Please sign in to comment.