Skip to content
This repository has been archived by the owner on Jul 3, 2024. It is now read-only.

Commit

Permalink
merge: PR #211 from chore/208-binary-architecture-staging
Browse files Browse the repository at this point in the history
  • Loading branch information
0xmemorygrinder committed Nov 22, 2023
2 parents 57660cb + 8f25dad commit 7369634
Show file tree
Hide file tree
Showing 22 changed files with 1,269 additions and 497 deletions.
91 changes: 91 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
on:
workflow_call:
inputs:
workspace:
required: true
type: string
description: "yarn workspace name"
command:
required: true
type: string
description: "yarn command to run"
workflow_dispatch:
inputs:
workspace:
required: true
type: string
description: "yarn workspace name"
command:
required: true
type: string
description: "yarn command to run"

jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
target: x86_64-pc-windows-msvc
code-target: win32-x64
- os: windows-latest
target: i686-pc-windows-msvc
- os: windows-latest
target: aarch64-pc-windows-msvc
code-target: win32-arm64
- os: ubuntu-20.04
target: x86_64-unknown-linux-gnu
code-target: linux-x64
#container: ubuntu:18.04
#- os: ubuntu-20.04
# target: aarch64-unknown-linux-gnu
# code-target: linux-arm64
#- os: ubuntu-20.04
# target: arm-unknown-linux-gnueabihf
# code-target: linux-armhf
- os: macos-11
target: x86_64-apple-darwin
code-target: darwin-x64
- os: macos-11
target: aarch64-apple-darwin
code-target: darwin-arm64
runs-on: ${{ matrix.os }}
#container: ${{ matrix.container }}

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3

- name: Setup yarn
id: setup-yarn
run: |
corepack enable
corepack prepare yarn@stable --activate
yarn set version stable
yarn -v
- name: Setup rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
override: true

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn install --frozen-lockfile
if: steps.yarn-cache.outputs.cache-hit != 'true'

- run: yarn workspace ${{ inputs.workspace }} run ${{ inputs.command }}
env:
CARGO_BUILD_TARGET: ${{ matrix.target }}

87 changes: 54 additions & 33 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
publish-libraries:
if : ${{ needs.setup.outputs.libraries != '[]' }}
runs-on: ubuntu-latest
continue-on-error: true
needs: setup
strategy:
fail-fast: false
Expand All @@ -53,7 +54,6 @@ jobs:
- name: Install dependencies
run: |
yarn install --immutable
cargo install wasm-pack
- name: Build
run: |
Expand All @@ -64,20 +64,20 @@ jobs:
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

publish:
compute-version:
if : ${{ needs.setup.outputs.extensions != '[]' }}
runs-on: ubuntu-latest
needs:
- setup
- publish-libraries
strategy:
fail-fast: false
matrix:
workspace: ${{ fromJson(needs.setup.outputs.extensions)}}
runs-on: ubuntu-latest
needs:
- setup
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/setup-node@v3
with:
node-version: '18.16.1'
Expand Down Expand Up @@ -142,7 +142,6 @@ jobs:
script: |
const fs = require('fs')
console.log("Change type is : ", "${{ steps.find-new-version.outputs.version_type}}")
if (fs.existsSync('.unstable') && "${{ steps.find-new-version.outputs.version_type}}" == "patch") {
const patch = parseInt('${{steps.find-new-version.outputs.patch}}', 10);
return "${{steps.find-new-version.outputs.major}}.${{steps.find-new-version.outputs.minor}}." + (patch + 1).toString();
Expand All @@ -151,40 +150,62 @@ jobs:
- name: Set tag
run: |
git tag "${{ matrix.workspace.name }}-${{ steps.tag.outputs.result }}"
git push origin "${{ matrix.workspace.name }}-${{ steps.tag.outputs.result }}"
git tag "${{ steps.get-tag-prefix.outputs.result }}-${{ steps.tag.outputs.result }}"
git push origin "${{ steps.get-tag-prefix.outputs.result }}-${{ steps.tag.outputs.result }}"
publish-core:
if: ${{ needs.setup.outputs.extensions != '[]' }}
needs:
- setup
- publish-libraries
- compute-version
strategy:
fail-fast: false
matrix:
workspace: ${{ fromJson(needs.setup.outputs.extensions)}}
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: '18.16.1'

- id: setup-yarn
# Install yarn 3 & workspace-tools
run: |
corepack enable
corepack prepare yarn@stable --activate
yarn -v
- name: Install dependencies
run: |
yarn install --immutable
cargo install wasm-pack
- name: Build
run: |
yarn workspace ${{ matrix.workspace.name }} build
yarn workspace ${{ matrix.workspace.name }} core:build
- name: Publish
run: yarn workspace ${{ matrix.workspace.name }} run publish ${{ github.ref_name == 'dev' && '--pre-release' || '' }} ${{ steps.tag.outputs.result }}
run: yarn workspace ${{ matrix.workspace.name }} run core:publish
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}


#- name: Run latest-tag
# uses: EndBug/latest-tag@latest
# with:
# # You can change the name of the tag or branch with this input.
# # Default: 'latest'
# ref: ${{ steps.tag.outputs.result }}
#
# # If a description is provided, the action will use it to create an annotated tag. If none is given, the action will create a lightweight tag.
# # Default: ''
# description: Description for the tag

# - name: Create GitHub release
# uses: Roang-zero1/github-create-release-action@v3
# with:
# created_tag: ${{ steps.find-new-version.outputs.version_tag }}
# release_title: ${{ steps.find-new-version.outputs.version_tag }}
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish-extensions:
if : ${{ needs.setup.outputs.extensions != '[]' }}
needs:
- setup
- publish-libraries
- compute-version
strategy:
fail-fast: false
matrix:
workspace: ${{ fromJson(needs.setup.outputs.extensions)}}
uses: ./.github/workflows/publish-extension.yml
with:
workspace: ${{ matrix.workspace.name }}
secrets:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
VSCE_PAT: ${{ secrets.VSCE_PAT }}
62 changes: 9 additions & 53 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,68 +103,24 @@ jobs:
- run: yarn workspace ${{ matrix.workspace.name }} run format

build:
runs-on: ubuntu-latest
needs: flatten-deps
strategy:
fail-fast: false
matrix:
workspace: ${{ fromJson(needs.flatten-deps.outputs.dependencies) }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3

- name: Setup yarn
id: setup-yarn
run: |
corepack enable
corepack prepare yarn@stable --activate
- name: install
run: cargo install wasm-pack

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn install --frozen-lockfile
if: steps.yarn-cache.outputs.cache-hit != 'true'

- run: yarn workspace ${{ matrix.workspace.name }} run build
uses: ./.github/workflows/build.yml
with:
workspace: ${{ matrix.workspace.name }}
command: build


test:
runs-on: ubuntu-latest
needs: flatten-deps
strategy:
fail-fast: false
matrix:
workspace: ${{ fromJson(needs.flatten-deps.outputs.dependencies) }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3

- name: Setup yarn
id: setup-yarn
run: |
corepack enable
corepack prepare yarn@stable --activate
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn install --frozen-lockfile
if: steps.yarn-cache.outputs.cache-hit != 'true'

- run: yarn workspace ${{ matrix.workspace.name }} run test
uses: ./.github/workflows/test.yml
with:
workspace: ${{ matrix.workspace.name }}
command: test
Loading

0 comments on commit 7369634

Please sign in to comment.