Skip to content

Commit

Permalink
update pipeline comments and json version
Browse files Browse the repository at this point in the history
  • Loading branch information
youngbryanyu committed Jan 17, 2024
1 parent e2a5a67 commit e35f01b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
23 changes: 11 additions & 12 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -13,7 +13,7 @@ on:
workflow_dispatch:

# Workflow stages
jobs:
jobs:
# Perform Lint Checks
lint:
name: Style and Lint Checks
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand Down
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "simple-app-config",
"version": "1.0.3",
"version": "1.0.4",
"description": "A simple configuration manager for different environments",
"repository": {
"type": "git",
Expand Down Expand Up @@ -33,8 +33,14 @@
"application-configuration",
"config",
"configuration",
"config-management",
"config management",
"configuration management",
"configuration-management",
"config-manager",
"config manager",
"configuration-manager",
"configuration manager",
".env",
"env",
"environment",
Expand Down

0 comments on commit e35f01b

Please sign in to comment.