-
Notifications
You must be signed in to change notification settings - Fork 10
ci(sdk): fix npm #452
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
Merged
Merged
ci(sdk): fix npm #452
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
7fbe709
fix: use nightly or latest for npm publishing
SeddikBellamine 40005e4
fix: add tag passing
SeddikBellamine d5e55d4
feat: add beta tag and nightly versioning for npm publishing
TartanLeGrand b4f83e2
ci: update publish job to run on ubuntu-latest
TartanLeGrand 0c426f0
feat: expose NIGHTLY_VERSION output in npm publish workflow
TartanLeGrand 88acc18
fix: correct version output reference in npm publish workflow
TartanLeGrand c9eed88
feat: add checkout and Node.js setup steps in npm publish workflow
TartanLeGrand 3396859
fix: set working directory for nightly versioning in npm publish work…
TartanLeGrand ca7c8ca
fix: remove fallback for NIGHTLY_VERSION in npm publish workflow
TartanLeGrand f21c268
fix: update version output handling in npm publish workflow for night…
TartanLeGrand dc081fe
fix: update output variable for nightly version in npm publish workflow
TartanLeGrand 07a2220
fix: update workflow reference to publish-npm version 1.4.0 in npm pu…
TartanLeGrand File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -3,23 +3,52 @@ name: Publish Package NPM | |
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| target: | ||
| description: 'Select deployment target' | ||
| tag: | ||
| description: 'NPM tag to publish (latest or nightly)' | ||
| required: true | ||
| default: staging | ||
| type: choice | ||
| options: | ||
| - staging | ||
| - prod | ||
| - latest | ||
| - nightly | ||
| - beta | ||
| default: nightly | ||
|
|
||
| jobs: | ||
| set-publish-version: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| - name: Set up Node.js | ||
| uses: actions/setup-node@v4 | ||
| - name: Set publish version | ||
| id: set-publish-version | ||
| if: github.event.inputs.tag == 'nightly' | ||
| working-directory: packages/sdk | ||
| run: | | ||
| if [ "${{ github.event.inputs.tag }}" == "nightly" ]; then | ||
| CURRENT_VERSION=$(npm pkg get version | tr -d '"') | ||
| NIGHTLY_VERSION="${CURRENT_VERSION}-nightly-${GITHUB_SHA::7}" | ||
| echo "VERSION=${NIGHTLY_VERSION}" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "VERSION=$(npm pkg get version | tr -d '"')" >> $GITHUB_OUTPUT | ||
| fi | ||
| outputs: | ||
| VERSION: ${{ steps.set-publish-version.outputs.VERSION }} | ||
|
|
||
| publish-npm: | ||
| uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/[email protected] | ||
| uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/[email protected] | ||
| needs: set-publish-version | ||
| with: | ||
| scope: '@iexec/dataprotector-sdk' | ||
| registry: 'https://registry.npmjs.org' | ||
| node-version: '18' | ||
| environment: ${{ github.event.inputs.target }} | ||
| working-directory: packages/sdk | ||
| working-directory: packages/sdk | ||
| tag: ${{ github.event.inputs.tag }} | ||
| version: ${{ needs.set-publish-version.outputs.VERSION }} | ||
| install-command: | | ||
| npm ci | ||
| npm run codegen | ||
| secrets: | ||
| npm-token: ${{ secrets.NPM_TOKEN }} | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.