Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ts Tests #152

Merged
merged 7 commits into from
Sep 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .generator
56 changes: 41 additions & 15 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,42 @@ on:
branches: [master]

jobs:
genNewVersion:
name: Check and get a new version for release
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Get Version
run: |
cd ./.generator/SchemaGenerator
MSG=$(dotnet run --updateVersion | grep "New version")
VERSION=$(echo $MSG | awk -F': ' '{print $2}')
echo "ReleaseVersion $VERSION"
echo "ReleaseVersion=$VERSION" >> $GITHUB_ENV
outputs:
ReleaseVersion: ${{ env.ReleaseVersion }}

buildCSharp:
name: Build release CSharp
runs-on: windows-latest
needs: [genNewVersion]
env:
RELEASE_VERSION: ${{ needs.genNewVersion.outputs.ReleaseVersion }}

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Generate files and update Assembly Version
- name: Generate files
shell: bash
run: |
cd ./.generator/SchemaGenerator
dotnet run --genCsModel --genCsInterface --updateVersion
MSG=$(dotnet run --updateVersion | grep "New version")
VERSION=$(echo $MSG | awk -F': ' '{print $2}')
echo "ReleaseVersion $VERSION"
echo "ReleaseVersion=$VERSION" >> $GITHUB_ENV

- name: Create key pair for signing the assembly
if: github.ref == 'refs/heads/master'
Expand All @@ -37,7 +55,7 @@ jobs:
- name: Build
run: |
dotnet restore
dotnet build --configuration Release /nowarn:CS0472,CS0108
dotnet build --configuration Release

- name: Run Unit Tests
working-directory: src/DragonflySchema.Tests
Expand All @@ -53,14 +71,13 @@ jobs:
name: nugetPackage
path: ./*.nupkg

outputs:
tag: ${{ env.ReleaseVersion }}

buildTypeScript:
name: Build release TypeScript
name: Build TypeScript
runs-on: ubuntu-latest
needs: [genNewVersion]
env:
CI: ""
RELEASE_VERSION: ${{ needs.genNewVersion.outputs.ReleaseVersion }}

steps:
- uses: actions/checkout@v4
Expand All @@ -82,24 +99,33 @@ jobs:
working-directory: src/TypeScriptSDK
run: npm i

- name: Build module
working-directory: src/TypeScriptSDK
run: npm run build
# - name: Build and bundle module
# working-directory: src/TypeScriptSDK
# run: |
# npm run build
# npm run bundle:dts

- name: Pack package
- name: Build and pack package
working-directory: src/TypeScriptSDK
run: |
npm pack
cp ./*.tgz ./../../

- name: Unit tests
working-directory: src/TypescriptSDK.Tests
run: |
npm i ./../TypeScriptSDK/dragonfly-schema-${{env.RELEASE_VERSION}}.tgz
npm i honeybee-schema
npm run test

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: npmPackage
path: ./*.tgz

release:
name: both CSharp and TypeScript SDK
name: Release both CSharp and TypeScript SDK
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
needs: [buildCSharp, buildTypeScript]
Expand Down
Loading
Loading