-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* start prepping for building release in CI * correct core versions * love me some peer deps * ci * geez * fix test script * ci * ci * ci * try ci * restructure * some more tweaks * try adding step for publishing release version
- Loading branch information
Showing
76 changed files
with
330 additions
and
395 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,162 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
tags: "*.*.*" | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
test: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# Stay on the oldest Ubuntu version that's still supported by Github Actions | ||
# to avoid glibc incompatibilities as far as possible. | ||
# TODO: Can we enable macos-arm here? | ||
os: [macos-latest, ubuntu-20.04, windows-latest] | ||
# syntax explanation: | ||
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#example-including-additional-values-into-combinations | ||
include: | ||
- os: macos-latest | ||
artifact-folder: darwin | ||
# - os: macos-arm | ||
# artifact-folder: darwinarm64 | ||
- os: ubuntu-20.04 | ||
artifact-folder: linux | ||
- os: windows-latest | ||
artifact-folder: win32 | ||
|
||
runs-on: ${{matrix.os}} | ||
|
||
steps: | ||
# needed for Windows testing | ||
- name: Set git to use LF | ||
run: | | ||
git config --global core.autocrlf false | ||
git config --global core.eol lf | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Cache OCaml's opam | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.opam | ||
key: ${{matrix.os}}-rescript-vscode-v4 | ||
|
||
- name: Use OCaml | ||
uses: ocaml/setup-ocaml@v2 | ||
with: | ||
ocaml-compiler: 4.14.x | ||
|
||
- name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
|
||
- run: npm ci --legacy-peer-deps | ||
- run: opam install dune cppo | ||
# - run: npm run res:build | ||
|
||
# These 2 runs (or just the second?) are for when you have opam dependencies. We don't. | ||
# Don't add deps. But if you ever do, un-comment these and add an .opam file. | ||
# - run: opam pin add resgraph.dev . --no-action | ||
# - run: opam install . --deps-only --with-doc --with-test | ||
|
||
- name: Build and test | ||
run: opam exec -- make test | ||
|
||
# Also avoids artifacts upload permission loss: | ||
# https://github.com/actions/upload-artifact/tree/ee69f02b3dfdecd58bb31b4d133da38ba6fe3700#permission-loss | ||
- name: Compress files | ||
run: | | ||
cd bin | ||
mkdir ${{matrix.artifact-folder}} | ||
mv dev/resgraph.exe ${{matrix.artifact-folder}} | ||
tar -cvf binary.tar ${{matrix.artifact-folder}} | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{matrix.os}} | ||
path: bin/binary.tar | ||
|
||
package: | ||
needs: test | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
|
||
- run: npm ci --legacy-peer-deps | ||
- run: npm run res:build | ||
|
||
- name: Download MacOS binary | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: macos-latest | ||
path: ./bin | ||
- run: tar -xvf binary.tar | ||
working-directory: ./bin | ||
|
||
#- name: Download MacOS ARM binary | ||
# uses: actions/download-artifact@v3 | ||
# with: | ||
# name: macos-arm | ||
# path: ./bin | ||
#- run: tar -xvf binary.tar | ||
# working-directory: ./bin | ||
|
||
- name: Download Linux binary | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: ubuntu-20.04 | ||
path: ./bin | ||
- run: tar -xvf binary.tar | ||
working-directory: ./bin | ||
|
||
- name: Download Windows binary | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: windows-latest | ||
path: ./bin | ||
- run: tar -xvf binary.tar | ||
working-directory: ./bin | ||
|
||
- name: Cleanup tar file | ||
run: rm binary.tar | ||
working-directory: ./bin | ||
|
||
- name: Store short commit SHA for filename | ||
id: vars | ||
env: | ||
COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }} | ||
run: echo "::set-output name=sha_short::${COMMIT_SHA:0:7}" | ||
|
||
- name: Store tag name | ||
id: tag_name | ||
if: startsWith(github.ref, 'refs/tags/') | ||
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/} | ||
|
||
- name: Package release | ||
run: npm pack | ||
|
||
- name: Rename package | ||
run: mv resgraph*.tgz resgraph.tgz | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: resgraph.tgz | ||
path: resgraph.tgz | ||
|
||
- name: Publish release version if wanted | ||
if: startsWith(github.ref, 'refs/tags/') | ||
uses: JS-DevTools/npm-publish@v1 | ||
with: | ||
token: ${{ secrets.NPM_TOKEN }} | ||
package: ./package.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# ResGraph Changelog | ||
|
||
## main | ||
|
||
## 0.1.0 | ||
|
||
Initial release! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
@@directive("#!/usr/bin/env node") | ||
|
||
@val | ||
external argv: array<option<string>> = "process.argv" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.