Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ jobs:
with:
language: javascript
repo-url: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
commit-sha: ${{ github.event.workflow_run && github.event.workflow_run.head_sha || github.event.pull_request.head.sha || github.sha }}
commit-sha: ${{ github.event.pull_request.head.sha || github.sha }}
25 changes: 9 additions & 16 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ jobs:
publish-ea:
if: |
github.event_name == 'workflow_run' &&
github.event.workflow_run.head_branch == 'main'
github.event.workflow_run.head_branch == 'main' &&
github.event.workflow_run.event == 'push'
runs-on: ubuntu-latest
name: Publish EA release to NPM
steps:
Expand Down Expand Up @@ -58,14 +59,6 @@ jobs:
# Remove both -ea. and -ea- formats for compatibility
BASE_VERSION=$(echo "$VERSION" | sed -E 's/-ea[.-][0-9]+$//')
echo "base-version=$BASE_VERSION" >> "$GITHUB_OUTPUT"
echo "current-version=$VERSION" >> "$GITHUB_OUTPUT"

- name: Update package with EA version
id: bump
run: |
EA_VERSION="${{ steps.current-version.outputs.base-version }}-ea-${{ github.run_number }}"
npm version "$EA_VERSION" --no-git-tag-version
echo "version=$EA_VERSION" >> "$GITHUB_OUTPUT"

- name: Install project modules
run: npm ci
Expand All @@ -74,14 +67,14 @@ jobs:
run: npm run compile

- name: Publish package
run: npm publish --verbose --tag ea --access public --provenance

- name: Commit and push package modifications
run: |
git add package.json
git add package-lock.json
git commit -m "build: updated package with ${{ steps.bump.outputs.version }} [skip ci]"
git push
SHORT_SHA=$(git rev-parse --short "${{ github.event.workflow_run.head_sha }}")
EA_VERSION="${{ steps.current-version.outputs.base-version }}-ea.${SHORT_SHA}"
# Temporarily update version for publish
npm version "$EA_VERSION" --no-git-tag-version
npm publish --verbose --tag ea --access public --provenance
# Restore original version
npm version "${{ steps.current-version.outputs.base-version }}" --no-git-tag-version

publish-release:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@trustify-da/trustify-da-javascript-client",
"version": "0.2.4-ea.13",
"version": "0.2.4",
"description": "Code-Ready Dependency Analytics JavaScript API.",
"license": "Apache-2.0",
"homepage": "https://github.com/guacsec/trustify-da-javascript-client#README.md",
Expand Down
Loading