fix gulp 2 #33
Workflow file for this run
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
name: CI | |
on: [push, pull_request] | |
jobs: | |
# TODO build for all platforms | |
build-cli: | |
name: Build compiler | |
strategy: | |
matrix: | |
target: | |
# - target: x86_64-unknown-linux-musl | |
# os: ubuntu-latest | |
# build-name: relay | |
# artifact-name: relay-bin-linux-x64 | |
# packages: musl-tools | |
# features: vendored | |
# - target: aarch64-unknown-linux-musl | |
# os: ubuntu-latest | |
# build-name: relay | |
# artifact-name: relay-bin-linux-arm64 | |
# features: vendored | |
# cross: true | |
- target: x86_64-apple-darwin | |
os: macos-latest | |
build-name: isograph_cli | |
artifact-name: isograph_cli-macos-x64 | |
- target: aarch64-apple-darwin | |
os: macos-latest | |
build-name: isograph_cli | |
artifact-name: isograph_cli-macos-arm64 | |
# - target: x86_64-pc-windows-msvc | |
# os: windows-latest | |
# build-name: relay.exe | |
# artifact-name: relay-bin-win-x64 | |
runs-on: ${{ matrix.target.os }} | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: 1.72.0 | |
override: true | |
target: ${{ matrix.target.target }} | |
- name: "Build isograph_cli with cargo (${{matrix.target.target}})" | |
run: cargo build --target ${{ matrix.target.target }} --release | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ matrix.target.artifact-name }} | |
path: target/${{ matrix.target.target }}/release/${{ matrix.target.build-name }} | |
if-no-files-found: error | |
# TODO build all demos | |
build-demos: | |
name: Build demos | |
runs-on: macos-latest | |
needs: [build-cli] | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: 1.72.0 | |
override: true | |
target: x86_64-apple-darwin | |
- name: "Download cli binary" | |
uses: actions/download-artifact@v2 | |
with: | |
name: isograph_cli-macos-x64 | |
path: artifacts/macos-x64 | |
- name: Make artifact executable | |
run: chmod +x ./artifacts/macos-x64/isograph_cli | |
- name: "Build project" | |
run: ./artifacts/macos-x64/isograph_cli --config ./demos/graphql-conf-2023-demo/isograph.config.json | |
- name: "Check working directory status" | |
run: "./scripts/check-git-status.sh" | |
build-js-packages: | |
name: Build js packages | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
- name: Use Node.js 16 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
cache: "pnpm" | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile --ignore-scripts | |
- name: Build | |
run: pnpm -r compile | |
main-release: | |
name: Release compiler to npm | |
runs-on: macos-latest | |
if: github.event_name == 'push' && github.repository == 'isographlabs/isograph' | |
needs: [build-js-packages, build-cli, build-demos] | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: 16 | |
registry-url: https://registry.npmjs.org/ | |
cache: "pnpm" | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile --ignore-scripts | |
- name: Change package versions to commit | |
run: yarn gulp setMainVersion | |
env: | |
RELEASE_COMMIT_SHA: ${{ github.sha }} | |
# TODO reuse this somehow? | |
- name: Build | |
run: pnpm -r compile | |
- name: Download artifact isograph_cli-macos-arm64 | |
uses: actions/download-artifact@v2 | |
with: | |
name: isograph_cli-macos-arm64 | |
path: libs/isograph-compiler/artifacts/macos-arm64 | |
- name: Download artifact isograph_cli-macos-arm64 | |
uses: actions/download-artifact@v2 | |
with: | |
name: isograph_cli-macos-x64 | |
path: libs/isograph-compiler/artifacts/macos-x64 | |
- name: Mark binaries as executable | |
run: | | |
chmod +x libs/isograph-compiler/artifacts/macos-arm64/isograph_cli | |
chmod +x libs/isograph-compiler/artifacts/macos-x64/isograph_cli | |
- name: | |
Publish to NPM | |
# if: github.ref == 'refs/heads/main' || github.ref_type == 'tag' && startsWith(github.ref_name, 'v') | |
run: | | |
for pkg in libs/*; do | |
npm publish "$pkg" --tag main | |
done | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} |