WIP
This commit is contained in:
+3
-1
@@ -1,4 +1,6 @@
|
|||||||
#!/usr/bin/env -S node --loader ts-node/esm --disable-warning=ExperimentalWarning
|
#!/usr/bin/env bun
|
||||||
|
|
||||||
|
// #!/usr/bin/env -S node --loader ts-node/esm --disable-warning=ExperimentalWarning
|
||||||
|
|
||||||
// eslint-disable-next-line n/shebang
|
// eslint-disable-next-line n/shebang
|
||||||
import {execute} from '@oclif/core'
|
import {execute} from '@oclif/core'
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env bun
|
||||||
|
|
||||||
import {execute} from '@oclif/core'
|
import {execute} from '@oclif/core'
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "jj",
|
"name": "jj-command-line",
|
||||||
"description": "jj cli",
|
"description": "jj cli",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"author": "Jason Jafari",
|
"author": "Jason Jafari",
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
import {runCommand} from '@oclif/test'
|
|
||||||
import {expect} from 'chai'
|
|
||||||
|
|
||||||
describe('hello', () => {
|
|
||||||
it('runs hello', async () => {
|
|
||||||
const {stdout} = await runCommand('hello friend --from oclif')
|
|
||||||
expect(stdout).to.contain('hello friend from oclif!')
|
|
||||||
})
|
|
||||||
})
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import {runCommand} from '@oclif/test'
|
|
||||||
import {expect} from 'chai'
|
|
||||||
|
|
||||||
describe('hello world', () => {
|
|
||||||
it('runs hello world cmd', async () => {
|
|
||||||
const {stdout} = await runCommand('hello world')
|
|
||||||
expect(stdout).to.contain('hello world!')
|
|
||||||
})
|
|
||||||
})
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "../tsconfig",
|
|
||||||
"compilerOptions": {
|
|
||||||
"noEmit": true
|
|
||||||
},
|
|
||||||
"references": [
|
|
||||||
{"path": ".."}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
# test
|
|
||||||
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: |
|
|
||||||
yarn
|
|
||||||
yarn 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
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
name: publish
|
|
||||||
|
|
||||||
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: yarn
|
|
||||||
- uses: JS-DevTools/npm-publish@19c28f1ef146469e409470805ea4279d47c3d35c
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.NPM_TOKEN }}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
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: yarn
|
|
||||||
- run: yarn
|
|
||||||
- run: yarn build
|
|
||||||
- run: yarn test
|
|
||||||
Reference in New Issue
Block a user