Skip to content

Release Build

Release Build #6

Workflow file for this run

name: Release Build
on:
release:
types: published
workflow_dispatch: # This line makes the workflow runnable on demand
jobs:
cancel-previous-runs:
name: Cancel Previous Runs
runs-on: ubuntu-20.04
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
build:
name: PPX Build Matrix
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
- name: Install OPAM and OCaml
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: 4.12.1
- name: Install OCaml Dependencies and build
run: |
cd ppx_src
opam install dune
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then
opam config exec -- opam install -y . --deps-only
opam config exec -- dune build
else
eval $(opam env)
opam install -y . --deps-only
dune build
fi
- name: Upload Build Mac / Linux
if: ${{ matrix.os != 'windows-latest' }}
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.os }}
path: ppx_src/_esy/default/build/default/bin/bin.exe
retention-days: 1
- name: Upload Build Windows
if: ${{ matrix.os == 'windows-latest' }}
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.os }}
path: ppx_src/_esy/default/store/b/*/default/bin/bin.exe
retention-days: 1
npm-release:
name: NPM Release
runs-on: ubuntu-latest
if: github.event.action == 'published'
needs:
- build
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
- name: Download Artifacts
uses: actions/download-artifact@v2
- name: Move / Rename Artifacts
run: |
mv ubuntu-latest/bin.exe ./ppx-linux.exe
mv macos-latest/bin.exe ./ppx-osx.exe
mv windows-latest/*/default/bin/bin.exe ./ppx-windows.exe
- uses: actions/setup-node@v1
with:
always-auth: true
registry-url: "https://registry.npmjs.org"
- env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
yarn publish