Skip to content

Commit

Permalink
ci: create publish workflow (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkusJx authored Apr 14, 2023
1 parent 264c58b commit d9b767e
Show file tree
Hide file tree
Showing 7 changed files with 161 additions and 73 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Publish

on:
workflow_dispatch:
inputs:
dry-run:
description: 'Dry run'
type: boolean
required: false
default: 'false'

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js environment
uses: actions/[email protected]
with:
node-version: 16.x
- name: Install Dependencies
run: npm ci
- name: Build
run: npm run build
- name: NPM Publish
uses: JS-DevTools/npm-publish@v1
with:
access: public
token: ${{ secrets.NPM_TOKEN }}
dry-run: ${{ github.event.inputs.dry-run == 'true' }}

draft-release:
needs: [build]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' && github.event.inputs.dry-run != 'true'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get version
id: version
run: echo "version=$(node -p 'require(`./package.json`).version')" >> $GITHUB_ENV
shell: bash
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ env.version }}
release_name: Release v${{ env.version }}
body: |
Auto-generated release
draft: true
prerelease: false
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ It can either be invoked from the command line or used as a library.

## Installation

_Note: You need to install `java-bridge` separately_

```bash
npm install -g java-ts-definition-generator
npm install -g java-ts-definition-generator java-bridge
```

## Command line usage
Expand Down Expand Up @@ -72,7 +74,7 @@ java-ts-gen ./project java.lang.String java.util.ArrayList
## Library usage

```ts
import { TypescriptDefinitionGenerator } from 'java-bridge';
import { TypescriptDefinitionGenerator } from 'java-ts-definition-generator';

const generator = new TypescriptDefinitionGenerator('java.lang.String');
// Generate the typescript definitions
Expand Down
160 changes: 96 additions & 64 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d9b767e

Please sign in to comment.