-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update pipeline comments and json version
- Loading branch information
1 parent
e2a5a67
commit e35f01b
Showing
2 changed files
with
18 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ name: CI/CD Pipeline | |
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
pull_request: | ||
branches: [ "main" ] | ||
# Schedule pipeline to run monday midnight after sunday ends | ||
schedule: | ||
|
@@ -13,7 +13,7 @@ on: | |
workflow_dispatch: | ||
|
||
# Workflow stages | ||
jobs: | ||
jobs: | ||
# Perform Lint Checks | ||
lint: | ||
name: Style and Lint Checks | ||
|
@@ -77,11 +77,10 @@ jobs: | |
run: pnpm run build | ||
|
||
# Detect if there were code changes on PR and push and save the result to: | ||
# - File artifact | ||
# - Environment variable (only available within the scope of this job, thus need artifact to pass to other jobs) | ||
# - File artifact (since environment variables are limited to the scope they're created in) | ||
detect-code-changes: | ||
name: Detect Code Changes | ||
if: github.event_name == 'push' || github.event_name == 'pull_request' | ||
if: github.event_name == 'push' || github.event_name == 'pull_request' | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
|
@@ -92,7 +91,7 @@ jobs: | |
id: changed-files | ||
uses: tj-actions/[email protected] | ||
- name: Set CHANGED_FILES as environment variable | ||
env: | ||
env: | ||
CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} | ||
run: echo "CHANGED_FILES=${{ steps.changed-files.outputs.all_changed_files }}" >> $GITHUB_ENV | ||
- name: Check for non-Markdown and non-pipeline changes | ||
|
@@ -109,7 +108,7 @@ jobs: | |
name: code-changes-artifact | ||
path: code_changes.txt | ||
|
||
# Verify new NPM version is updated during push and PR. | ||
# Verify new NPM version is updated during push and PR. | ||
# Skips version number check step if there were code changes | ||
verify-npm-version: | ||
name: Verify Updated NPM version (if code changed) | ||
|
@@ -133,8 +132,8 @@ jobs: | |
echo "CODE_CHANGES=$(cat code_changes.txt)" >> $GITHUB_ENV | ||
- name: Install dependencies | ||
run: npm install | ||
- name: Check if version number is updated | ||
if: env.CODE_CHANGES == 'true' # only run verification if there were code changes | ||
- name: Check if version number is updated # only run if there were code changes | ||
if: env.CODE_CHANGES == 'true' | ||
id: check_version | ||
run: | | ||
LATEST_TAG=$(git describe --tags --abbrev=0) | ||
|
@@ -143,7 +142,7 @@ jobs: | |
echo "Version in package.json is already published. Exiting..." | ||
exit 1 | ||
fi | ||
# Publish to NPM if the event was 'push'. | ||
# Runs the publish to NPM step only if there were code changes | ||
publish-npm: | ||
|
@@ -170,7 +169,7 @@ jobs: | |
run: npm install | ||
- name: Get package version number | ||
run: echo "PACKAGE_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV | ||
- name: Publish to NPM | ||
- name: Publish to NPM # only run if there were code changes | ||
if: env.CODE_CHANGES == 'true' && env.PACKAGE_VERSION | ||
run: npm publish | ||
env: | ||
|
@@ -194,7 +193,7 @@ jobs: | |
echo "CODE_CHANGES=$(cat code_changes.txt)" >> $GITHUB_ENV | ||
- name: Extract version number | ||
run: echo "RELEASE_VERSION=$(jq -r .version package.json)" >> $GITHUB_ENV | ||
- name: Create Release | ||
- name: Create Release # only run if there were code changes | ||
if: env.CODE_CHANGES == 'true' | ||
uses: actions/create-release@v1 | ||
env: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters