Skip to content

Commit

Permalink
add first release draft
Browse files Browse the repository at this point in the history
  • Loading branch information
hirsch88 committed Feb 27, 2024
1 parent 3da5f83 commit 7763c53
Show file tree
Hide file tree
Showing 32 changed files with 204 additions and 47 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/actions/angular-build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: 'Angular Build'
description: 'Angular Build'
inputs:
app:
description: 'The specific test application'
runs:
using: 'composite'
steps:
- name: Create App
run: bash build.sh ${{ inputs.app }}
working-directory: ./test/angular
shell: bash

- name: Install Cypress
run: npm run cy:install
working-directory: ./test/angular/${{ inputs.app }}
shell: bash

- name: Build Angular App
run: npm run build
working-directory: ./test/angular/${{ inputs.app }}
shell: bash
15 changes: 0 additions & 15 deletions .github/workflows/actions/angular-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,3 @@ runs:
name: testing-dist
path: ./packages/testing
filename: TestingDist.zip

- name: Setup App
run: bash build.sh ${{ inputs.app }}
working-directory: ./test/angular
shell: bash

- name: Install Cypress
run: npm run cy:install
working-directory: ./test/angular/${{ inputs.app }}
shell: bash

- name: Build Angular App
run: npm run build
working-directory: ./test/angular/${{ inputs.app }}
shell: bash
27 changes: 27 additions & 0 deletions .github/workflows/actions/release-build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: 'Build'
description: 'Build'
runs:
using: 'composite'
steps:
- name: Clean install
shell: bash
run: npm ci

- name: Define Nx cache
uses: nrwl/nx-set-shas@v4

- name: Check format
shell: bash
run: npx nx format:check

- name: Check spelling
shell: bash
run: npm run spell

- name: Lint & Test & Build
shell: bash
run: npx nx run-many -t build --projects=tag:scope:release

- name: Releae dry-run
shell: bash
run: npx nx release publish -d
27 changes: 27 additions & 0 deletions .github/workflows/actions/release-setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: 'Setup Release'
description: 'Setup Release'
inputs:
token:
description: 'The GitHub token required.'
npm-token:
description: 'The NPM authentication token required to publish.'
runs:
using: 'composite'
steps:
- name: Git Identity
run: |
git config --global user.name 'baopso'
git config --global user.email '[email protected]'
git remote set-url origin https://$GITHUB_ACTOR:[email protected]/$GITHUB_REPOSITORY
shell: bash
env:
GITHUB_TOKEN: ${{ inputs.token }}

- name: Create .npmrc
run: |
cat << EOF > "$HOME/.npmrc"
//registry.npmjs.org/:_authToken=$NPM_TOKEN
EOF
shell: bash
env:
NPM_TOKEN: ${{ inputs.npm-token }}
5 changes: 4 additions & 1 deletion .github/workflows/continuous.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ jobs:
- uses: ./.github/workflows/actions/angular-setup
with:
app: ${{ matrix.apps }}
- uses: ./.github/workflows/actions/angular
- uses: ./.github/workflows/actions/angular-build
with:
app: ${{ matrix.apps }}
- uses: ./.github/workflows/actions/angular-test
with:
app: ${{ matrix.apps }}
89 changes: 89 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Release

on:
push:
branches:
- main

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
Release:
name: 🚀 Release
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/workflows/actions/setup
- uses: ./.github/workflows/actions/release-setup
with:
token: ${{ secrets.GITHUB_TOKEN }}
npm-token: ${{ secrets.NPM_PUBLISH_TOKEN }}

- uses: ./.github/workflows/actions/release-build

# - name: Create Release Pull Request or Publish to npm
# id: changesets
# uses: changesets/action@v1
# with:
# publish: npm run release
# env:
# HUSKY_DISABLED: 1
# BAL_DS_RELEASE: true
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}

# - name: Echo Changeset output
# shell: bash
# run: |
# echo "Changeset published - ${{ steps.changesets.outputs.published }}"
# echo "Changeset publishedPackages - ${{ steps.changesets.outputs.publishedPackages }}"
# echo "Changeset hasChangesets - ${{ steps.changesets.outputs.hasChangesets }}"
# echo "Changeset pullRequestNumber - ${{ steps.changesets.outputs.pullRequestNumber }}"

# - name: Update lock file
# if: steps.changesets.outputs.published == 'true'
# run: npm install
# shell: bash

# - name: Commit lock file
# if: steps.changesets.outputs.published == 'true'
# uses: EndBug/add-and-commit@v9
# with:
# add: 'package-lock.json'
# message: 'chore(): update lock file'
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# - name: Tag release
# if: steps.changesets.outputs.published == 'true'
# uses: thejeff77/[email protected]
# with:
# tag: 'v${{ fromJson(steps.changesets.outputs.publishedPackages)[0].version }}'
# message: 'v${{ fromJson(steps.changesets.outputs.publishedPackages)[0].version }}'

# - name: Update changelog file
# if: steps.changesets.outputs.published == 'true'
# run: awk 'NR==1 {print "# Changelog"} NR!=1' packages/components/CHANGELOG.md > CHANGELOG.md
# shell: bash

# - name: Commit changelog
# if: steps.changesets.outputs.published == 'true'
# uses: EndBug/add-and-commit@v9
# with:
# add: 'CHANGELOG.md'
# message: 'chore(): update changelog'
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# - name: Merge main -> production
# if: steps.changesets.outputs.published == 'true'
# uses: devmasx/merge-branch@master
# with:
# type: now
# from_branch: main
# target_branch: production
# message: ':bookmark: release: ${{ fromJson(steps.changesets.outputs.publishedPackages)[0].version }}'
# github_token: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion docs/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,6 @@
"figmaTokensAssetPath": "packages/tokens/dist/figma"
}
}
}
},
"tags": ["scope:docs", "type:docs"]
}
2 changes: 1 addition & 1 deletion e2e/cypress/e2e/visual/bal-nav-menu-flyout.visual.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('bal-nav-menu-flyout', () => {

cy.platform('mobile')
cy.testVisual('menu-flyout-mobile', {
errorThreshold: 0.2,
errorThreshold: 0.25,
capture: 'viewport',
clip: balViewport['mobile'],
})
Expand Down
3 changes: 2 additions & 1 deletion e2e/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@
"command": "echo done",
"outputs": ["{options.outputFile}"]
}
}
},
"tags": ["scope:e2e", "scope:visual", "type:test"]
}
2 changes: 1 addition & 1 deletion libs/nx/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@
}
}
},
"tags": []
"tags": ["scope:dev", "type:lib"]
}
2 changes: 1 addition & 1 deletion libs/output-target-angular/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@
}
}
},
"tags": []
"tags": ["scope:release", "type:lib"]
}
2 changes: 1 addition & 1 deletion libs/output-target-react/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@
}
}
},
"tags": []
"tags": ["scope:release", "type:lib"]
}
2 changes: 1 addition & 1 deletion libs/output-target-vue/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@
}
}
},
"tags": []
"tags": ["scope:release", "type:lib"]
}
4 changes: 2 additions & 2 deletions packages/angular-common/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "packages/angular-common/src",
"prefix": "bal",
"tags": [],
"projectType": "library",
"targets": {
"build": {
Expand All @@ -22,5 +21,6 @@
},
"defaultConfiguration": "production"
}
}
},
"tags": ["scope:release", "type:package"]
}
4 changes: 2 additions & 2 deletions packages/angular-legacy/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "packages/angular-legacy/src",
"prefix": "bal",
"tags": [],
"projectType": "library",
"targets": {
"build": {
Expand All @@ -23,5 +22,6 @@
},
"defaultConfiguration": "production"
}
}
},
"tags": ["scope:release", "type:package"]
}
4 changes: 2 additions & 2 deletions packages/angular-module/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "packages/angular-module/src",
"prefix": "bal",
"tags": [],
"projectType": "library",
"targets": {
"build": {
Expand All @@ -23,5 +22,6 @@
},
"defaultConfiguration": "production"
}
}
},
"tags": ["scope:release", "type:package"]
}
4 changes: 2 additions & 2 deletions packages/angular/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "packages/angular/src",
"prefix": "lib",
"tags": [],
"projectType": "library",
"targets": {
"build": {
Expand All @@ -23,5 +22,6 @@
},
"defaultConfiguration": "production"
}
}
},
"tags": ["scope:release", "type:package"]
}
2 changes: 1 addition & 1 deletion packages/brand-icons/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,5 @@
}
}
},
"tags": []
"tags": ["scope:release", "scope:docs", "scope:visual", "type:package"]
}
2 changes: 1 addition & 1 deletion packages/core/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@
}
}
},
"tags": []
"tags": ["scope:release", "scope:docs", "scope:visual", "type:package"]
}
2 changes: 1 addition & 1 deletion packages/css/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
}
}
},
"tags": []
"tags": ["scope:release", "type:package"]
}
2 changes: 1 addition & 1 deletion packages/devkit/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
}
}
},
"tags": []
"tags": ["scope:release", "type:package"]
}
3 changes: 2 additions & 1 deletion packages/favicons/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
"command": "eslint --no-eslintrc",
"outputs": ["{options.outputFile}"]
}
}
},
"tags": ["scope:release", "scope:docs", "scope:visual", "type:package"]
}
3 changes: 2 additions & 1 deletion packages/fonts/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
"command": "eslint --no-eslintrc",
"outputs": ["{options.outputFile}"]
}
}
},
"tags": ["scope:release", "scope:docs", "scope:visual", "type:package"]
}
2 changes: 1 addition & 1 deletion packages/icons/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,5 @@
}
}
},
"tags": []
"tags": ["scope:release", "scope:docs", "scope:visual", "type:package"]
}
2 changes: 1 addition & 1 deletion packages/maps/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@
}
}
},
"tags": []
"tags": ["scope:release", "scope:docs", "scope:visual", "type:package"]
}
4 changes: 2 additions & 2 deletions packages/react/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "packages/react/src",
"projectType": "library",
"tags": [],
"targets": {}
"targets": {},
"tags": ["scope:release", "type:package"]
}
2 changes: 1 addition & 1 deletion packages/styles/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
}
}
},
"tags": []
"tags": ["scope:release", "scope:docs", "scope:visual", "type:package"]
}
2 changes: 1 addition & 1 deletion packages/table/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@
}
}
},
"tags": []
"tags": ["scope:release", "scope:docs", "type:package"]
}
Loading

0 comments on commit 7763c53

Please sign in to comment.