Skip to content

Commit

Permalink
Fix ci (#15)
Browse files Browse the repository at this point in the history
* fix ci

* release
  • Loading branch information
mununki authored Dec 5, 2022
1 parent f849ce2 commit ad4fc02
Show file tree
Hide file tree
Showing 6 changed files with 97 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Build Windows
on: [workflow_dispatch]

jobs:
build_macos:
build_windows:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
Expand Down
44 changes: 43 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,42 @@ jobs:
path: ppx.exe
if-no-files-found: error

build_windows:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
ocaml-compiler:
- 4.12.1

steps:
- uses: actions/checkout@v3

- name: Use OCaml ${{ matrix.ocaml-compiler}}
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}

- name: Install deps
run: opam install . --deps-only --with-test

- name: Build
run: opam exec -- dune build

- name: Copy built PPX file
run: |
mv ./_build/default/bin/bin.exe ppx.exe
- name: (only on release) Upload artifacts ${{ matrix.os }}
uses: actions/upload-artifact@master
with:
name: ${{ matrix.os }}
path: ppx.exe
if-no-files-found: error

publish:
needs: [build_linux, build_macos]
needs: [build_linux, build_macos, build_windows]
name: (only on release) Publish
runs-on: ubuntu-18.04
steps:
Expand All @@ -96,12 +130,20 @@ jobs:
name: macOS-latest
path: binaries/darwin

- name: Download windows artifacts
if: success()
uses: actions/download-artifact@master
with:
name: windows-latest
path: binaries/windows

- name: Move artifacts
if: success()
run: |
mkdir -p bin
mv binaries/linux/ppx.exe ppx-linux.exe
mv binaries/darwin/ppx.exe ppx-osx.exe
mv binaries/windows/ppx.exe ppx-windows.exe
- name: Publish
if: success()
Expand Down
44 changes: 43 additions & 1 deletion .github/workflows/publish_prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,42 @@ jobs:
path: ppx.exe
if-no-files-found: error

build_windows:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
ocaml-compiler:
- 4.12.1

steps:
- uses: actions/checkout@v3

- name: Use OCaml ${{ matrix.ocaml-compiler}}
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}

- name: Install deps
run: opam install . --deps-only --with-test

- name: Build
run: opam exec -- dune build

- name: Copy built PPX file
run: |
mv ./_build/default/bin/bin.exe ppx.exe
- name: (only on release) Upload artifacts ${{ matrix.os }}
uses: actions/upload-artifact@master
with:
name: ${{ matrix.os }}
path: ppx.exe
if-no-files-found: error

publish:
needs: [build_linux, build_macos]
needs: [build_linux, build_macos, build_windows]
name: (only on release) Publish
runs-on: ubuntu-18.04
steps:
Expand All @@ -102,12 +136,20 @@ jobs:
name: macOS-latest
path: binaries/darwin

- name: Download windows artifacts
if: success()
uses: actions/download-artifact@master
with:
name: windows-latest
path: binaries/windows

- name: Move artifacts
if: success()
run: |
mkdir -p bin
mv binaries/linux/ppx.exe ppx-linux.exe
mv binaries/darwin/ppx.exe ppx-osx.exe
mv binaries/windows/ppx.exe ppx-windows.exe
- name: Change npm release version
if: success()
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# CHANGELOG

# 0.1.7

#### :rocket: New Feature

- Add Windows platform support
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@greenlabs/ppx-ts",
"version": "0.1.6",
"version": "0.1.7",
"description": "ReScript PPX helps binding to typescript modules",
"license": "MIT",
"author": "Greenlabs Dev <[email protected]>",
Expand All @@ -19,4 +19,4 @@
"scripts": {
"postinstall": "node ./postInstall.js"
}
}
}
2 changes: 1 addition & 1 deletion ppx_ts.opam
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
version: "0.1.6"
version: "0.1.7"
synopsis: "A PPX helps binding to typescript modules"
description: ""
maintainer: ["[email protected]"]
Expand Down

0 comments on commit ad4fc02

Please sign in to comment.