Skip to content

Commit

Permalink
Merge pull request #71 from unsplash/maintenance/v0.2.1
Browse files Browse the repository at this point in the history
maintenance/v0.2.1
  • Loading branch information
Magellol authored Feb 3, 2022
2 parents 431425f + e0362b0 commit ba0fcc2
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
]
runs-on: ${{ matrix.os.runner }}
if: startsWith(github.event.ref, 'refs/tags/v')
needs: [build, test, lint]
needs: [build, test, lint, fmt]
steps:
- uses: actions/checkout@v2
- uses: haskell/actions/setup@v1
Expand Down
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

**Currently for internal use but feedback/external usage welcome**


Compile ICU messages into code.

```
Expand All @@ -27,4 +26,16 @@ $ intlc compile ./translations.json -l en-US

---

Currently building against GHC 8.10.7.
## Publishing new release

Pushing a git tag will trigger a build on github actions. It will build binaries for different OS and create a new release with them attached.
By convention tags will have the following format `v{major}.{minor}.{patch}`

We don't fully have everything automated so here's what you should do whenever you need to publish a new intlc version:

- Bump `intlc.cabal`
- `git tag v{version} && git push {remote} v{version}`
- Bump intlc version in `@unsplash/intlc` postinstall script to match the latest intlc https://github.com/unsplash/intlc/blob/master/npm/package.json#L7
- Bump `@unsplash/intlc` package.json version and publish **only** when the brand new release is available on github.

_Currently building against GHC 8.10.7._
2 changes: 1 addition & 1 deletion intlc.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 2.2
name: intlc
version: 0.1.0
version: 0.2.1
license: MIT
build-type: Simple

Expand Down
11 changes: 11 additions & 0 deletions npm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,16 @@ Wrapper that installs the requested `intlc` binary for your OS and make it avail

### Publishing

This package contains a `postinstall` script that downloads an intlc binary targeted by a specific version. That release must be available on github, otherwise the script will fail.
As convention this package version follows `intlc` version. Anything after the dash is specific to this package, for instance if you need to fix a bug.

e.g

```
[email protected] -> @unsplash/[email protected]
[email protected] -> @unsplash/[email protected]
[email protected] -> @unsplash/[email protected]{,1,2,3,4,5,6,...} // This last number can be bumped independently of intlc's binary
```

We configure this package as a `bin` in `package.json`. Note that we must create a `intlc` placeholder file in the dist folder because NPM checks for that file prior to run the `postinstall` script.
We've inspired ourselves to what purescript does: https://github.com/purescript/purescript/commit/32b0c1fb451a58c5e1f3d8ed3acbfb905b1ff155
4 changes: 2 additions & 2 deletions npm/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "@unsplash/intlc",
"version": "0.2.0-0",
"version": "0.2.1-0",
"description": "intlc wrapper that makes it available as a local dependency",
"license": "MIT",
"scripts": {
"postinstall": "node dist/index.js v0.2.0",
"postinstall": "node dist/index.js v0.2.1",
"prepublishOnly": "rm -rf ./dist && tsc && touch ./dist/intlc"
},
"bin": {
Expand Down

0 comments on commit ba0fcc2

Please sign in to comment.