-
Notifications
You must be signed in to change notification settings - Fork 4
CLI update #18
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
CLI update #18
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
7a1ad61
chore: update oclif lib and add tests
zone117x b3edfec
chore: do not include oclif plugins
zone117x 09ac1e1
ci: remove redundant lint
zone117x e63605c
chore: possible fix for Windows
zone117x e1d4a7a
ci: PR trigger maybe not needed
zone117x fc5b95e
chore: restore codeowners file
zone117x 11c128a
chore: package version bump
zone117x 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| name: version, tag and github release | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
|
|
||
| jobs: | ||
| release: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-node@v4 | ||
| - name: Check if version already exists | ||
| id: version-check | ||
| run: | | ||
| package_version=$(node -p "require('./package.json').version") | ||
| exists=$(gh api repos/${{ github.repository }}/releases/tags/v$package_version >/dev/null 2>&1 && echo "true" || echo "") | ||
|
|
||
| if [ -n "$exists" ]; | ||
| then | ||
| echo "Version v$package_version already exists" | ||
| echo "::warning file=package.json,line=1::Version v$package_version already exists - no release will be created. If you want to create a new release, please update the version in package.json and push again." | ||
| echo "skipped=true" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "Version v$package_version does not exist. Creating release..." | ||
| echo "skipped=false" >> $GITHUB_OUTPUT | ||
| echo "tag=v$package_version" >> $GITHUB_OUTPUT | ||
| fi | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GH_TOKEN }} | ||
| - name: Setup git | ||
| if: ${{ steps.version-check.outputs.skipped == 'false' }} | ||
| run: | | ||
| git config --global user.email ${{ secrets.GH_EMAIL }} | ||
| git config --global user.name ${{ secrets.GH_USERNAME }} | ||
| - name: Generate oclif README | ||
| if: ${{ steps.version-check.outputs.skipped == 'false' }} | ||
| id: oclif-readme | ||
| run: | | ||
| npm install | ||
| npm exec oclif readme | ||
| if [ -n "$(git status --porcelain)" ]; then | ||
| git add . | ||
| git commit -am "chore: update README.md" | ||
| git push -u origin ${{ github.ref_name }} | ||
| fi | ||
| - name: Create Github Release | ||
| uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 | ||
| if: ${{ steps.version-check.outputs.skipped == 'false' }} | ||
| with: | ||
| name: ${{ steps.version-check.outputs.tag }} | ||
| tag: ${{ steps.version-check.outputs.tag }} | ||
| commit: ${{ github.ref_name }} | ||
| token: ${{ secrets.GH_TOKEN }} | ||
| skipIfReleaseExists: true | ||
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 |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| name: publish | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @wileyj same here |
||
|
|
||
| on: | ||
| release: | ||
| types: [released] | ||
|
|
||
| jobs: | ||
| publish: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: latest | ||
| - run: npm install | ||
| - run: npm run build | ||
| - run: npm run prepack | ||
| - uses: JS-DevTools/npm-publish@19c28f1ef146469e409470805ea4279d47c3d35c | ||
| with: | ||
| token: ${{ secrets.NPM_TOKEN }} | ||
| - run: npm run postpack | ||
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 |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| name: tests | ||
| on: | ||
| push: | ||
| branches-ignore: [main] | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| unit-tests: | ||
| strategy: | ||
| matrix: | ||
| os: ['ubuntu-latest', 'windows-latest'] | ||
| node_version: [lts/-1, lts/*, latest] | ||
| fail-fast: false | ||
| runs-on: ${{ matrix.os }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ matrix.node_version }} | ||
| cache: npm | ||
| - run: npm install | ||
| - run: npm run build | ||
| - run: npm run test |
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 |
|---|---|---|
| @@ -1,5 +1,14 @@ | ||
| *.log | ||
| .DS_Store | ||
| node_modules | ||
| dist | ||
| lib | ||
| *-debug.log | ||
| *-error.log | ||
| **/.DS_Store | ||
| /.idea | ||
| /dist | ||
| /tmp | ||
| /node_modules | ||
| oclif.manifest.json | ||
|
|
||
|
|
||
|
|
||
| yarn.lock | ||
| pnpm-lock.yaml | ||
|
|
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 |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "require": [ | ||
| "ts-node/register" | ||
| ], | ||
| "watch-extensions": [ | ||
| "ts" | ||
| ], | ||
| "recursive": true, | ||
| "reporter": "spec", | ||
| "timeout": 60000 | ||
| } |
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 |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| "@oclif/prettier-config" |
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
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.
@wileyj the
oclif generate ..command used to update the CLI libraries added these release automation workflows. The code looks fine to me, but some repo secrets need to be added for it to work. Thoughts?