Skip to content

Upload package as artifact #21

Upload package as artifact

Upload package as artifact #21

Workflow file for this run

name: CI
on:
push:
branches: [master]
# See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-*"
pull_request:
branches: [master]
concurrency:
group: ci-${{ github.ref }}-1
# Cancel previous builds for pull requests only.
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [
macos-13, # x64
macos-14, # ARM
ubuntu-latest, # x64
buildjet-2vcpu-ubuntu-2204-arm, # ARM
windows-latest,
]
runs-on: ${{matrix.os}}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- name: NPM install
run: npm ci
- name: Build
run: npx rescript
- name: Pack
run: npm pack
- name: Test
env:
CI: 1
shell: bash
run: |
npm i -g ./create-rescript-app-*.tgz
npx create-rescript-app
- name: Prepare package upload
# For pull requests, pass the correct commit SHA explicitly as GITHUB_SHA points to the wrong commit.
run: node .github/workflows/prepare_package_upload.js ${{ github.event.pull_request.head.sha }}
- name: "Upload artifact: npm package"
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v4
with:
name: ${{env.artifact_filename}}
path: ${{env.artifact_filename}}