-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
97 additions
and
44 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
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,59 @@ | ||
name: Compile binaries | ||
on: | ||
workflow_call: | ||
inputs: | ||
publishType: | ||
description: 'Publish either packages or only compiled Rust Core bridge' | ||
required: true | ||
jobs: | ||
# Compile native bridge code for Windows, Mac and Linux. | ||
# Uploads the packages as a build artifact to be tested later. | ||
compile-binaries: | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
include: | ||
- os: ubuntu-latest | ||
target: x86_64-unknown-linux-gnu | ||
# TODO: this compliation target fails | ||
# https://github.com/temporalio/sdk-typescript/runs/4241087289?check_suite_focus=true#step:8:119 | ||
# - os: ubuntu-latest | ||
# target: aarch64-unknown-linux-gnu | ||
- os: macos-latest | ||
target: x86_64-apple-darwin | ||
- os: macos-latest | ||
target: aarch64-apple-darwin | ||
- os: windows-latest | ||
target: x86_64-pc-windows-msvc | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: 16 | ||
- name: Add ${{ matrix.target }} rust target | ||
run: rustup target add ${{ matrix.target }} | ||
- run: npm ci | ||
- run: npm run build | ||
- name: Cross compile rust code | ||
run: npx lerna run --stream build-rust -- -- --target ${{ matrix.target }} | ||
# Restore the CLI JS only on Windows because Windows build changes the | ||
# file attributes causing publish to think the change is uncommitted | ||
- run: git restore packages/create-project/cli.js | ||
if: ${{ matrix.os == 'windows-latest' }} | ||
- run: node scripts/publish-to-verdaccio.js --registry-dir /tmp/registry | ||
if: ${{ inputs.publishType == 'packages' }} | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: packages-${{ matrix.target }} | ||
path: /tmp/registry/storage | ||
if: ${{ inputs.publishType == 'packages' }} | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: compiled-bridge-${{ matrix.target }} | ||
path: ${{ github.workspace }}/packages/core-bridge/releases/${{ matrix.target }} |
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,34 @@ | ||
name: Publish to npm | ||
on: workflow_dispatch | ||
inputs: | ||
npmTag: | ||
description: 'npm tag to publishing to (Use either `latest` or `next`)' | ||
required: false | ||
default: 'next' | ||
npmVersion: | ||
description: 'package version to publish to npm' | ||
required: false | ||
default: 'prerelease' | ||
|
||
jobs: | ||
compile-binaries: | ||
# TODO: main | ||
uses: temporalio/sdk-typescript/.github/workflows/compile-binaries.yml@auto-publish | ||
with: | ||
publishType: core-bridge | ||
|
||
publish: | ||
runs-on: ubuntu-latest | ||
needs: compile-binaries | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: 16 | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
path: ${{ github.workspace }}/packages/core-bridge/releases | ||
|
||
- run: ls -l ./packages/core-bridge/releases |