Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: move workflow dispatch to separate job #424

Merged
merged 1 commit into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/continuous-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on:
branches:
- main
pull_request:
workflow_dispatch:

jobs:
continuous-integration:
Expand Down
54 changes: 54 additions & 0 deletions .github/workflows/update-component-progress.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Update component progress

on: workflow_dispatch:

jobs:
publish-npm:
name: Publish to npm
runs-on: ubuntu-latest
needs: continuous-integration
if: github.ref == 'refs/heads/main'

steps:
- name: Download code from GitHub
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
with:
token: ${{ secrets.GH_REPO_TOKEN }}

- name: Install pnpm package manager
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0

- name: Set up Node.js version
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version-file: .nvmrc
cache: pnpm

- name: Install dependencies as specified in package.json
run: |
pnpm install --frozen-lockfile
pnpm ls --recursive

- name: Run the build script in package.json scripts
env:
GH_ISSUES_TOKEN: ${{ secrets.GH_ISSUES_TOKEN }}
run: pnpm run --if-present build

- name: Publish to GitHub repository
env:
GITHUB_TOKEN: ${{ secrets.GH_REPO_TOKEN }}
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }}
GIT_AUTHOR_NAME: "NL Design System"
GIT_COMMITTER_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }}
GIT_COMMITTER_NAME: "NL Design System"
run: |
git push --set-upstream origin HEAD
pnpm run release:component-progress

- name: Publish to npm repository
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
pnpm config set "//registry.npmjs.org/:_authToken" "${NPM_TOKEN}"
pnpm run publish
pnpm config delete "//registry.npmjs.org/:_authToken"
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@
"prepare": "husky",
"prettier": "prettier --write .",
"publish": "lerna publish from-package --yes",
"release": "lerna version prerelease --conventional-prerelease --force-publish=@nl-design-system/component-progress --no-changelog --no-private --yes",
"release": "lerna version prerelease --conventional-prerelease --no-changelog --no-private --yes",
"release:component-progress": "lerna version prerelease --conventional-prerelease --force-publish=@nl-design-system/component-progress --no-changelog --no-private --yes",
"update-patch": "npm-check-updates --configFileName .ncurc.patch.cjs",
"update-minor": "npm-check-updates --configFileName .ncurc.minor.cjs",
"update-major": "npm-check-updates --configFileName .ncurc.major.cjs"
Expand Down