-
Notifications
You must be signed in to change notification settings - Fork 451
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
[nan-668] add verification bash script to publish packages #1930
Merged
khaliqgant
merged 41 commits into
master
from
khaliq/nan-668-add-cli-test-to-ensure-bad-versions-are-published-that-wont
Apr 3, 2024
Merged
Changes from 38 commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
1be386a
[nan-668] add verification bash script to publish packages
khaliqgant e7d6736
[nan-668] skip version check
khaliqgant ebbaef5
[nan-668] fix hash check
khaliqgant e3468d4
[nan-668] add token
khaliqgant 48ac9d4
[nan-668] set npmrc
khaliqgant 1c2ce3c
[nan-668] debug
khaliqgant 693bc99
Merge branch 'master' of github.com:NangoHQ/nango into khaliq/nan-668…
khaliqgant c739262
[nan-668] build and ignore scripts
khaliqgant b2df7af
[nan-668] publish from the github action
khaliqgant e400702
[nan-668] ignore scripts and build at each stage
khaliqgant bb6769e
[nan-668] build hosted
khaliqgant 36f5e7d
[nan-668] explicit with the npmrc
khaliqgant d35efe8
[nan-668] remove package specific npmrc
khaliqgant 10ff590
[nan-668] workspaces-update to false
khaliqgant 9777444
[nan-668] install shared version
khaliqgant cfdf267
[nan-668] debug
khaliqgant 3615e9f
[nan-668] always auth
khaliqgant ac8c2f3
[nan-668] override package.json
khaliqgant 18ec0ca
[nan-668] fix path
khaliqgant c852337
[nan-668] install after updating the package.json
khaliqgant 0d2f23e
[nan-668] bump all and publish
khaliqgant 90f0549
[nan-668] ref correct package
khaliqgant 45376ec
[nan-668] build before publishing
khaliqgant b1f2693
[nan-668] install after each step
khaliqgant 7144770
[nan-668] remove wonk
khaliqgant 2098fd5
[nan-668] remove short
khaliqgant 27726fb
[nan-668] publish cli under scope
khaliqgant 72af132
[nan-668] no need to bump
khaliqgant 95dc821
[nan-668] correct package reference
khaliqgant b644104
install in tmp directory
khaliqgant 7dfcdb5
[nan-668] make dir
khaliqgant ec42c9f
[nan-668] correct scope
khaliqgant cf9b4b4
[nan-668] navigate out of the repo
khaliqgant 23804b4
[nan-668] global install and test
khaliqgant 33fcf09
[nan-668] init and generate
khaliqgant 2cb08a1
[nan-668] local install and use npx
khaliqgant a6c639b
[nan-668] ignore mode
khaliqgant f9448fc
[nan-668] cd into nango integrations before trying to generate
khaliqgant 9706481
[nan-668] verify version
khaliqgant 97915e0
[nan-668] fail on purpose
khaliqgant 720da7a
[nan-668] add expected version format
khaliqgant 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 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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: CLI Publish & Verify | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- staging/** | ||
pull_request: | ||
|
||
concurrency: | ||
group: verify-cli-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
publish-and-test: | ||
runs-on: ubuntu-latest | ||
env: | ||
NANGO_CLI_UPGRADE_MODE: ignore | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: '18.x' | ||
registry-url: 'https://npm.pkg.github.com' | ||
scope: '@nangohq' | ||
always-auth: true | ||
- name: Publish npm packages to the github registry | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
shell: bash | ||
continue-on-error: true | ||
run: | | ||
GIT_HASH=$(git rev-parse HEAD) | ||
bash ./scripts/publish.sh 0.0.1-$GIT_HASH | ||
- name: Publish the cli privately under the correct scope | ||
working-directory: packages/cli | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
jq '.name = "@nangohq/cli"' package.json > temp.json && mv temp.json package.json | ||
npm publish --access public | ||
- name: Install the cli from the github package registry | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
GIT_HASH=$(git rev-parse HEAD) | ||
mkdir nango-cli-test && cd nango-cli-test | ||
npm init -y | ||
npm install @nangohq/cli@0.0.1-$GIT_HASH | ||
npx nango version --debug | ||
bodinsamuel marked this conversation as resolved.
Show resolved
Hide resolved
bodinsamuel marked this conversation as resolved.
Show resolved
Hide resolved
|
||
npx nango init --debug | ||
cd nango-integrations | ||
npx nango generate --debug |
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't the cli published by running the
publish.sh
script in the previous step? why do we need to publish it again?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It attempts to publish it but fails because it is not scoped under our organization
@nangohq
which is why I rename the package and publish it separately.nango/.github/workflows/cli-verification.yaml
Lines 39 to 45 in f9448fc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not doing that directly then?
Also doesn't it will publish @nangohq/node and @nangohq/shared every time for nothing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Easier to reuse the script which bumps the references and packages correctly.
Shared needs to be published, node is published again and not used as is frontend but there is no harm in publishing those packages.