Skip to content

Commit

Permalink
release: wrappers version 1.21.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nathalielindqvist committed Dec 12, 2024
1 parent a245274 commit e244a31
Show file tree
Hide file tree
Showing 37 changed files with 23,283 additions and 18,907 deletions.
94 changes: 0 additions & 94 deletions .github/workflows/beta-release-core.yml

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/holy-grail.yml
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ jobs:
run: npm ci

- name: Angular - Run build
run: npm run build-angular
run: npm run build:angular

- name: Angular - Publish
working-directory: packages/angular
Expand Down Expand Up @@ -262,7 +262,7 @@ jobs:
run: npm ci

- name: Angular-17 - Run build
run: npm run build-angular-17
run: npm run build:angular-17

- name: Angular-17 - Publish
working-directory: packages/angular-17/dist/components
Expand Down Expand Up @@ -306,7 +306,7 @@ jobs:
run: npm ci

- name: React - Build
run: npm run build-react
run: npm run build:react

- name: React - Publish
working-directory: packages/react
Expand Down
103 changes: 39 additions & 64 deletions .github/workflows/smoke-test-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,40 @@ on:

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
branch:
description: 'Branch name'
required: true
default: 'develop'
type: string

nodeVersion:
description: 'Node version'
required: true
default: '20.9.0'
type: string

jobs:
release-core:
build-core:
runs-on: ubuntu-latest
env:
WORKING_DIRECTORY: packages/core
outputs:
version: ${{ steps.core-version.outputs.PACKAGE_VERSION }}
steps:
- name: Check out code
uses: actions/checkout@v4
with:
ref: develop
ref: ${{ github.event.inputs.branch }}

- name: Set up node
uses: actions/setup-node@v3
with:
node-version: '20.9.0' # You can change this to any fixed version if needed
node-version: ${{ github.event.inputs.nodeVersion }}
registry-url: 'https://registry.npmjs.org'

- name: Set Tegel user
run: git config --global user.name "Tegel - Scania" && git config --global user.email "tegel.design.system@gmail.com"

- name: Core - Read Package.json Version
id: version
id: core-version
working-directory: ${{ env.WORKING_DIRECTORY }}
run: echo "PACKAGE_VERSION=$(jq -r .version package.json)" >> $GITHUB_OUTPUT

Expand All @@ -44,32 +55,23 @@ jobs:
working-directory: ${{ env.WORKING_DIRECTORY }}
run: npm run build

- name: Core - Publish (dry-run)
working-directory: ${{ env.WORKING_DIRECTORY }}
run: npm publish --tag latest --dry-run
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

release-angular:
needs: release-core
build-angular:
needs: build-core
runs-on: ubuntu-latest
env:
WORKING_DIRECTORY: packages/angular
steps:
- name: Check out code
uses: actions/checkout@v4
with:
ref: develop
ref: ${{ github.event.inputs.branch }}

- name: Set up node
uses: actions/setup-node@v3
with:
node-version: '20.9.0'
node-version: ${{ github.event.inputs.nodeVersion }}
registry-url: 'https://registry.npmjs.org'

- name: Set Tegel user
run: git config --global user.name "Tegel - Scania" && git config --global user.email "tegel.design.system@gmail.com"

- name: Angular - Read package.json Version
id: version
working-directory: packages/angular
Expand All @@ -88,37 +90,28 @@ jobs:

- name: Angular - Install latest tegel package
working-directory: packages/angular
run: npm install @scania/tegel@${{ steps.version.outputs.PACKAGE_VERSION }}
run: npm install @scania/tegel@${{ needs.build-core.outputs.version }}

- name: Angular - Run build
run: npm run build-angular

- name: Angular - Publish (dry-run)
working-directory: packages/angular
run: npm publish --tag latest --dry-run
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm run build:angular

release-angular-17:
needs: release-core
build-angular-17:
needs: build-core
runs-on: ubuntu-latest
env:
WORKING_DIRECTORY: packages/angular-17
steps:
- name: Check out code
uses: actions/checkout@v4
with:
ref: develop
ref: ${{ github.event.inputs.branch }}

- name: Set up node
uses: actions/setup-node@v3
with:
node-version: '20.9.0'
node-version: ${{ github.event.inputs.nodeVersion }}
registry-url: 'https://registry.npmjs.org'

- name: Set Tegel user
run: git config --global user.name "Tegel - Scania" && git config --global user.email "tegel.design.system@gmail.com"

- name: Angular-17 - Read package.json Version
id: version
working-directory: packages/angular-17/projects/components
Expand All @@ -141,41 +134,32 @@ jobs:

- name: Angular-17 workspace - Install latest tegel package
working-directory: packages/angular-17
run: npm install @scania/tegel@${{ steps.version.outputs.PACKAGE_VERSION }}
run: npm install @scania/tegel@${{ needs.build-core.outputs.version }}

- name: Angular-17 wrapper - Install latest tegel package
working-directory: packages/angular-17/projects/components
run: npm install @scania/tegel@${{ steps.version.outputs.PACKAGE_VERSION }}
run: npm install @scania/tegel@${{ needs.build-core.outputs.version }}

- name: Angular-17 - Run build
run: npm run build-angular-17

- name: Angular-17 - Publish (dry-run)
working-directory: packages/angular-17/dist/components
run: npm publish --tag latest --dry-run
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm run build:angular-17

release-react:
needs: release-core
build-react:
needs: build-core
runs-on: ubuntu-latest
env:
WORKING_DIRECTORY: packages/react
steps:
- name: Check out code
uses: actions/checkout@v4
with:
ref: develop
ref: ${{ github.event.inputs.branch }}

- name: Set up node
uses: actions/setup-node@v3
with:
node-version: '20.9.0'
node-version: ${{ github.event.inputs.nodeVersion }}
registry-url: 'https://registry.npmjs.org'

- name: Set Tegel user
run: git config --global user.name "Tegel - Scania" && git config --global user.email "tegel.design.system@gmail.com"

- name: React - Read package.json Version
id: version
working-directory: packages/react
Expand All @@ -194,25 +178,16 @@ jobs:

- name: React - Install latest tegel package
working-directory: packages/react
run: npm install @scania/tegel@${{ steps.version.outputs.PACKAGE_VERSION }}
run: npm install @scania/tegel@${{ needs.build-core.outputs.version }}

- name: React - Build
run: npm run build-react

- name: React - Publish (dry-run)
working-directory: packages/react
run: npm publish --tag latest --dry-run
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm run build:react

# Check that all jobs pass
check-results:
needs: [release-core, release-angular, release-angular-17, release-react]
needs: [build-core, build-angular, build-angular-17, build-react]
if: failure()
runs-on: ubuntu-latest
steps:
- name: Check results
run: |
echo "All previous jobs have completed successfully!"
- name: Notify in Teams on failure
if: failure()
uses: ./.github/workflows/smoke-test-webhook.yml
18 changes: 17 additions & 1 deletion docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,23 @@
- **Code Review Process**: We will review your PR and provide feedback. Once the PR is ready for merge, it will be merged by the maintainers.

## Style Guides
- **Code Style**: Please read our [Code Style](https://github.com/scania-digital-design-system/tegel/blob/main/CODE_STYLE.md) before contributing.
- **Code Style**: Please read our [Code Style](https://github.com/scania-digital-design-system/tegel/blob/main/.github/CODE_STYLE.md) before contributing.

## Testing your changes locally
To properly test your changes' behaviors in a project, reference your local Tegel instance instead of the published version on the registry
- **Build Tegel**: Navigate to your current Tegel monorepo directory, and run `npm run build-all`. This will build core Tegel as well as all packages currently supported (Angular, Angular 17 & React).
- **Linking**: Now building is done, navigate to `packages/core` within Tegel's repository and run `npm link`.
- **Using linked instance**: We're ready to work now, navigate to your project and run `npm link '@scania/tegel'`. This will create a symlink to the local package, but it won't add Tegel to your dependencies, if it wasn't already. Be sure to install it as dependency before linking, if required.

### (Optional) Testing Packages
In case you need to test React or Angular packages of Tegel, follow the instructions below replacing `{package}` for **react**, **angular** or **angular-17** respectively.
- **Building**: Complete the build step for Tegel and verify that the package you plan to test has been built successfully. There are commands available to only build specific packages, i.e., `npm run build-{package}`.
- **Linking**: After linking core, navigate to `packages/{package}` and execute `npm run link`.
- **Using linked instances**: In your project run `npm link '@scania/tegel-{package}'` before running `npm link '@scania/tegel'`.

### Unlinking
- **Removing from Project**: In the project you want the link to be removed execute `npm unlink '@scania/tegel'`. In case any dependency issue arises, delete the `node_modules` folder and run `npm i` to start fresh.
- **Removing link from npm**: The reference for your local instance is stored globally, to remove it execute `npm uninstall --global '@scania/tegel'`.

## Testing your changes locally
To properly test your changes' behaviors in a project, reference your local Tegel instance instead of the published version on the registry
Expand Down
Loading

0 comments on commit e244a31

Please sign in to comment.