Skip to content

Commit 75cbace

Browse files
committed
Add release-js workflow
1 parent fa520a1 commit 75cbace

File tree

5 files changed

+37
-6
lines changed

5 files changed

+37
-6
lines changed

.github/workflows/release-js.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Publish Package to npmjs
2+
on:
3+
push:
4+
branches:
5+
- main
6+
# release:
7+
# types: [created]
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
id-token: write
14+
steps:
15+
- uses: actions/checkout@v4
16+
# Setup .npmrc file to publish to npm
17+
18+
# - name: Install tinygo
19+
# Until 0.38.0 release, I won't rebuild the tinygo binary
20+
- uses: actions/setup-node@v4
21+
with:
22+
node-version: '20.x'
23+
registry-url: 'https://registry.npmjs.org'
24+
- run: |
25+
cd js
26+
npm ci
27+
npm publish --provenance --access public
28+
env:
29+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

cmd/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ var versionCmd = &cobra.Command{
1414
Use: "version",
1515
Short: "Print the version number of dockerfmt",
1616
Run: func(cmd *cobra.Command, args []string) {
17-
fmt.Println("dockerfmt 0.1.0")
17+
fmt.Println("dockerfmt 0.2.0")
1818
},
1919
}

js/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ Bindings around the Golang `dockerfmt` tooling.
55

66
```js
77
import { formatDockerfile } from '@reteps/dockerfmt'
8+
// Alternatively, you can use `formatDockerfileContents` to format a string instead of a file.
9+
810
const result = await formatDockerfile('../tests/comment.dockerfile', { indent: 4, trailingNewline: true })
911

1012
console.log(result)

js/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "dockerfmt",
3-
"version": "0-2.0",
2+
"name": "@reteps/dockerfmt",
3+
"version": "0.2.0-alpha",
44
"type": "module",
55
"scripts": {
66
"test": "echo \"Error: no test specified\" && exit 1",
@@ -10,10 +10,10 @@
1010
"build": "npm run build-go && npm run build-js"
1111
},
1212
"files": [
13-
"index.d.cts",
14-
"format.wasm"
13+
"dist"
1514
],
16-
"main": "format.js",
15+
"main": "dist/format.js",
16+
"types": "dist/format.d.ts",
1717
"author": "Peter Stenger <[email protected]>",
1818
"repository": "git+https://github.com/reteps/dockerfmt/tree/main/js",
1919
"license": "MIT",
File renamed without changes.

0 commit comments

Comments
 (0)