Skip to content

Commit

Permalink
Pre-alpha - S-108988 - Updated github workflows for github and npm re…
Browse files Browse the repository at this point in the history
…pos (#12)

* Updated github workflows for github and npm repos

* Updating plugin versions after prealpha test (#17)

* Update dai-release-common-push.yaml

* pre-alpha test commit (#15)

* pre-alpha commits (#16)

* pre-alpha test commit

* Test commits on all plugins

* CI: bumps version to dai-release-common/v0.1.1-alpha.0 [skip ci]

* chore: update dependencies

* CI: bumps version to dai-release-backend/v0.1.1-alpha.0 [skip ci]

* CI: bumps version to dai-release/v0.1.1-alpha.0 [skip ci]

* Reverting test commits

---------

Co-authored-by: Automated Version Bump <gh-action-bump-version@users.noreply.github.com>
Co-authored-by: GitHub Actions <>

* Reset package version to 0.0.1

* Reset dependent package version to 0.0.1

* Reset dependent package version to 0.0.1

---------

Co-authored-by: Automated Version Bump <gh-action-bump-version@users.noreply.github.com>
  • Loading branch information
nelson-digi and Automated Version Bump authored May 21, 2024
1 parent 05efa42 commit 62c5348
Show file tree
Hide file tree
Showing 15 changed files with 404 additions and 74 deletions.
27 changes: 22 additions & 5 deletions .github/workflows/dai-release-backend-publish.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,28 @@
name: Publish dai-release-backend plugin

on: workflow_dispatch
on:
workflow_dispatch:
inputs:
github-publish:
description: 'Github publish'
required: true
default: false
type: boolean
npm-publish:
description: 'Npm publish'
required: true
default: false
type: boolean

jobs:
call-ci-workflow:
name: Run build & test for dai-release-backend plugin
uses: ./.github/workflows/reusable-build.yaml
github-publish:
if: ${{ inputs.github-publish == true }}
uses: ./.github/workflows/github-publish.yaml
with:
plugin-path: ./plugins/dai-release-backend
npm-publish:
if: ${{ inputs.npm-publish == true }}
uses: ./.github/workflows/npm-publish.yaml
secrets: inherit
with:
plugin-path: ./plugins/dai-release-backend
publish: true
23 changes: 13 additions & 10 deletions .github/workflows/dai-release-backend-push.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
name: Push to main on dai-release-backend plugin

on:
push:
branches: [ "main" ]
paths-ignore:
# Ignore changes to READMEs and other Markdown.
- 'plugins/dai-release-backend/**/README*'
- 'plugins/dai-release-backend/**/*.md'
- 'plugins/dai-release/**'
- 'plugins/dai-release-common/**'
on: workflow_call

jobs:
call-ci-workflow:
name: Run build & test for dai-release-backend plugin
uses: ./.github/workflows/reusable-build.yaml
with:
plugin-path: ./plugins/dai-release-backend
plugin-path: ./plugins/dai-release-backend
version-tag:
uses: ./.github/workflows/version.yaml
needs: [ call-ci-workflow ]
with:
plugin-path: ./plugins/dai-release-backend
plugin: dai-release-backend
github-publish:
needs: [ call-ci-workflow, version-tag ]
uses: ./.github/workflows/github-publish.yaml
with:
plugin-path: ./plugins/dai-release-backend
28 changes: 23 additions & 5 deletions .github/workflows/dai-release-common-publish.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,29 @@
name: Publish dai-release-common plugin

on: workflow_dispatch
on:
workflow_dispatch:
inputs:
github-publish:
description: 'Github publish'
required: true
default: false
type: boolean
npm-publish:
description: 'Npm publish'
required: true
default: false
type: boolean

jobs:
call-ci-workflow:
name: Run build & test for dai-release-common plugin
uses: ./.github/workflows/reusable-build.yaml
github-publish:
if: ${{ inputs.github-publish == true }}
uses: ./.github/workflows/github-publish.yaml
with:
plugin-path: ./plugins/dai-release-common
publish: true
npm-publish:
if: ${{ inputs.npm-publish == true }}
uses: ./.github/workflows/npm-publish.yaml
secrets: inherit
with:
plugin-path: ./plugins/dai-release-common

69 changes: 61 additions & 8 deletions .github/workflows/dai-release-common-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,70 @@ name: Push to main on dai-release-common plugin

on:
push:
branches: [ "main" ]
paths-ignore:
# Ignore changes to READMEs and other Markdown.
- 'plugins/dai-release-common/**/README*'
- 'plugins/dai-release-common/**/*.md'
- 'plugins/dai-release/**'
- 'plugins/dai-release-backend/**'
branches: [ "main" ] # need to map it to main branch

jobs:
changes:
runs-on: ubuntu-latest
outputs:
common: ${{ steps.changes.outputs.common }}
backend: ${{ steps.changes.outputs.backend }}
frontend: ${{ steps.changes.outputs.frontend }}
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
common:
- 'plugins/dai-release-common/**'
backend:
- 'plugins/dai-release-backend/**'
frontend:
- 'plugins/dai-release/**'
base: ${{ github.ref_name }}
call-ci-workflow:
needs: changes
if: ${{ needs.changes.outputs.common == 'true' }}
name: Run build & test for dai-release-common plugin
uses: ./.github/workflows/reusable-build.yaml
with:
plugin-path: ./plugins/dai-release-common
plugin-path: ./plugins/dai-release-common
version-tag:
uses: ./.github/workflows/version.yaml
needs: [ call-ci-workflow ]
with:
plugin-path: ./plugins/dai-release-common
plugin: dai-release-common
github-publish:
needs: [ call-ci-workflow, version-tag ]
uses: ./.github/workflows/github-publish.yaml
with:
plugin-path: ./plugins/dai-release-common
update-dependencies:
needs: [ call-ci-workflow, version-tag, github-publish ]
uses: ./.github/workflows/update-dependency.yaml

frontend-ci-workflow:
needs: changes
if: ${{ needs.changes.outputs.frontend == 'true' && needs.changes.outputs.common == 'false'}}
name: Run dai-release plugin without dai-release-common changes.
uses: ./.github/workflows/dai-release-push.yaml

frontend-common-ci-workflow:
needs: [changes, update-dependencies]
if: ${{ needs.changes.outputs.frontend == 'true' && needs.changes.outputs.common == 'true' }}
name: Run dai-release plugin with dai-release-common changes.
uses: ./.github/workflows/dai-release-push.yaml

backend-ci-workflow:
needs: changes
if: ${{ needs.changes.outputs.backend == 'true' && needs.changes.outputs.common == 'false'}}
name: Run dai-release-backend plugin without dai-release-common changes.
uses: ./.github/workflows/dai-release-backend-push.yaml

backend-common-ci-workflow:
needs: [changes, update-dependencies]
if: ${{ needs.changes.outputs.backend == 'true' && needs.changes.outputs.common == 'true' }}
name: Run dai-release-backend plugin with dai-release-common changes.
uses: ./.github/workflows/dai-release-backend-push.yaml
27 changes: 22 additions & 5 deletions .github/workflows/dai-release-publish.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,28 @@
name: Publish dai-release plugin

on: workflow_dispatch
on:
workflow_dispatch:
inputs:
github-publish:
description: 'Github publish'
required: true
default: false
type: boolean
npm-publish:
description: 'Npm publish'
required: true
default: false
type: boolean

jobs:
call-ci-workflow:
name: Run build & test for dai-release plugin
uses: ./.github/workflows/reusable-build.yaml
github-publish:
if: ${{ inputs.github-publish == true }}
uses: ./.github/workflows/github-publish.yaml
with:
plugin-path: ./plugins/dai-release
npm-publish:
if: ${{ inputs.npm-publish == true }}
uses: ./.github/workflows/npm-publish.yaml
secrets: inherit
with:
plugin-path: ./plugins/dai-release
publish: true
23 changes: 13 additions & 10 deletions .github/workflows/dai-release-push.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
name: Push to main on dai-release plugin

on:
push:
branches: [ "main" ]
paths-ignore:
# Ignore changes to READMEs and other Markdown.
- 'plugins/dai-release/**/README*'
- 'plugins/dai-release/**/*.md'
- 'plugins/dai-release-backend/**'
- 'plugins/dai-release-common/**'
on: workflow_call

jobs:
call-ci-workflow:
name: Run build & test for dai-release plugin
uses: ./.github/workflows/reusable-build.yaml
with:
plugin-path: ./plugins/dai-release
plugin-path: ./plugins/dai-release
version-tag:
uses: ./.github/workflows/version.yaml
needs: [ call-ci-workflow ]
with:
plugin-path: ./plugins/dai-release
plugin: dai-release
github-publish:
needs: [ call-ci-workflow, version-tag ]
uses: ./.github/workflows/github-publish.yaml
with:
plugin-path: ./plugins/dai-release
42 changes: 42 additions & 0 deletions .github/workflows/github-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Github publish

on:
workflow_call:
inputs:
plugin-path:
required: true
type: string

jobs:
github-publish:
name: Publish Latest to Github registry
runs-on: ubuntu-latest
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.ref_name }} # need to map it to main branch
- name: Use Node.js
uses: actions/setup-node@v3
with:
always-auth: true
node-version: '18.x'
registry-url: 'https://npm.pkg.github.com'
- name: Install dependencies
working-directory: ${{ inputs.plugin-path }}
run: yarn install
- name: Run tsc
working-directory: ${{ inputs.plugin-path }}
run: yarn tsc
- name: Build
working-directory: ${{ inputs.plugin-path }}
run: yarn build
- name: Run tests
working-directory: ${{ inputs.plugin-path }}
run: yarn test
- name: Publish to registry
working-directory: ${{ inputs.plugin-path }}
run: yarn publish
43 changes: 43 additions & 0 deletions .github/workflows/npm-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: NPM publish

on:
workflow_call:
inputs:
plugin-path:
required: true
type: string

jobs:
npm-publish:
name: Publish Latest to NPM
runs-on: ubuntu-latest
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # necessary to get newly created tag above
ref: ${{ github.ref_name }}
- name: Use Node.js
uses: actions/setup-node@v3
with:
always-auth: true
node-version: '18.x'
registry-url: 'https://registry.npmjs.org/'
scope: '@digital-ai'
- name: Install dependencies
working-directory: ${{ inputs.plugin-path }}
run: yarn install
- name: Run tsc
working-directory: ${{ inputs.plugin-path }}
run: yarn tsc
- name: Build
working-directory: ${{ inputs.plugin-path }}
run: yarn build
- name: Run tests
working-directory: ${{ inputs.plugin-path }}
run: yarn test
- name: Publish to registry
working-directory: ${{ inputs.plugin-path }}
run: yarn publish --access public
38 changes: 38 additions & 0 deletions .github/workflows/pr_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
## Release Checklist

- All steps below must be completed prior to merging.

## Author Checklist

### Required

- [ ] PR title should follows correct format.
- MAJOR Release is used when there are breaking changes involved
- MINOR Release is used when enhancements are introduced
- PATCH Release is used for defects, security, tech chores, etc.
- Note:
- Based on the commit messages, increment the version from the latest release.
- Push the bumped npm version in package.json back into the repo.
- Push a tag for the new version back into the repo.
- [For more details on versioning](https://github.com/phips28/gh-action-bump-version/blob/master/README.md)
- [ ] Checklist of **changes made** added to PR description
- [ ] Related issue(s) linked to PR


## Reviewer Checklist

- [ ] Author checklist has been reviewed?
- [ ] All acceptance criteria has been met from linked issue
- [ ] Run code locally and verify all changes







## Related Issue(s)

Resolves #XXXX
Story-######
Defect-######
Loading

0 comments on commit 62c5348

Please sign in to comment.