Skip to content

Commit

Permalink
20576: Adjusts workflows to use centralized NPM test/publish (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
apbassett authored Jun 19, 2024
1 parent 71ad6ad commit 28f1397
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 57 deletions.
63 changes: 6 additions & 57 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,66 +25,15 @@ jobs:
optional-release-tag: ${{ inputs.optional-release-tag }}

npm-test:
# Regression testing
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

# - name: Install dependencies
# run: npm ci

# - name: Test
# run: npm run test
uses: howsoai/.github/.github/workflows/npm-test.yml@main
secrets: inherit

release:
needs:
- metadata
- npm-test
if: inputs.build-type == 'release'
environment:
name: Artifactory
permissions:
contents: write
runs-on: ubuntu-latest
env:
NODE_AUTH_TOKEN: ${{ secrets.JFROG_ACCESS_TOKEN }}
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: "21.x"
registry-url: ${{ secrets.JFROG_URL }}/artifactory/npm-remote

- name: Set package version
run: |
sed -i "s|\"version\": \"0.0.0\"|\"version\": \"${{ needs.metadata.outputs.version }}\"|g" ./package.json
- name: Build and publish Node package
run: |
npm ci
npm run build
# Remove .npmrc so that we can easily change registries to npm-edge (for publishing)
rm -f .npmrc
- uses: actions/setup-node@v4
with:
node-version: "21.x"
registry-url: ${{ secrets.JFROG_URL }}/artifactory/api/npm/npm-edge/

- name: Publish Node package
run: |
npm publish
- name: Create Release
uses: ncipollo/release-action@v1
with:
tag: ${{ needs.metadata.outputs.version }}
commit: ${{ github.sha }}
name: "${{ github.event.repository.name }} ${{ needs.metadata.outputs.version }}"
artifactErrorsFailBuild: true
generateReleaseNotes: true
makeLatest: legacy
uses: howsoai/.github/.github/workflows/npm-release.yml@main
secrets: inherit
with:
version: ${{ needs.metadata.outputs.version }}
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@howso:registry = https://dpbuild.jfrog.io/artifactory/api/npm/npm-virtual/

0 comments on commit 28f1397

Please sign in to comment.