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

Implemented Serverless Workflow DSL v1.0.0-alpha1 #58

Merged
merged 2 commits into from
May 22, 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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 3 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ dotnet_style_prefer_compound_assignment = true:suggestion
dotnet_style_prefer_simplified_interpolation = true:suggestion
dotnet_style_namespace_match_folder = true:suggestion
dotnet_style_readonly_field = true:suggestion
dotnet_style_prefer_collection_expression = when_types_loosely_match:suggestion

[*.cs]
csharp_indent_labels = one_less_than_current
Expand Down Expand Up @@ -98,4 +99,5 @@ csharp_style_deconstructed_variable_declaration = true:suggestion
csharp_style_unused_value_assignment_preference = discard_variable:suggestion
csharp_style_unused_value_expression_statement_preference = discard_variable:silent

file_header_template = Copyright © 2023-Present The Serverless Workflow Specification Authors\n\nLicensed under the Apache License, Version 2.0 (the "License"),\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an "AS IS" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.
file_header_template = Copyright © 2024-Present The Serverless Workflow Specification Authors\n\nLicensed under the Apache License, Version 2.0 (the "License"),\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an "AS IS" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.
csharp_style_prefer_primary_constructors = true:suggestion
52 changes: 52 additions & 0 deletions .github/workflows/build-dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Build .NET

on:
pull_request:
branches: [ main ]
paths-ignore:
- '.github/**'
- '**/*.md'
- 'assets/**'
- 'deployments/**'
workflow_call:

env:
SOLUTION: ./ServerlessWorkflow.Sdk.sln

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: ['8.0.x' ]

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2

- name: Pull latest version tag
if: github.event_name != 'pull_request'
run: |
git fetch
git pull

- name: Setup .NET ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v2
with:
dotnet-version: ${{ matrix.dotnet-version }}

- name: Restore dependencies
run: dotnet restore "${{ env.SOLUTION }}"

- name: Build
run: dotnet build "${{ env.SOLUTION }}" --configuration Release --no-restore

- name: Cache build items
if: github.event_name != 'pull_request'
uses: actions/cache@v3
id: build-dotnet-cache
with:
path: ./**/Release/*.nupkg
key: build-dotnet-cache-${{ github.sha }}
35 changes: 35 additions & 0 deletions .github/workflows/ci-pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Continuous integration

on:
push:
branches: [ main ]
paths-ignore:
- '.github/**'
- '**/*.md'
- 'assets/**'
- 'deployments/**'
workflow_dispatch:

jobs:

#test:
# # Skip if it's not running in the main branch of the `serverlessworkflow/sdk-net` repo
# if: github.repository == 'serverlessworkflow/sdk-net' && github.ref_name == 'main'
# uses: ./.github/serverlessworkflow/sdk-net/test-dotnet.yml
# secrets: inherit

versioning:
#needs: [test]
if: github.repository == 'cloud-flows/sdk-net' && github.ref_name == 'main'
uses: ./.github/workflows/versioning.yml
secrets: inherit

build:
needs: [versioning]
uses: ./.github/workflows/build-dotnet.yml
secrets: inherit

release:
needs: [build]
uses: ./.github/workflows/release.yml
secrets: inherit
24 changes: 0 additions & 24 deletions .github/workflows/dotnet.yml

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Manual publish of .NET packages

on:
release:
types: [published]
workflow_dispatch:

env:
SOLUTION: ./ServerlessWorkflow.Sdk.sln
REGISTRY: ghcr.io

jobs:
publish-packages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore "${{ env.SOLUTION }}"
- name: Build
run: dotnet build "${{ env.SOLUTION }}" --configuration Release --no-restore
- name: Push1
run: dotnet nuget push "./src/*/bin/Release/*.nupkg" --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
39 changes: 39 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Release

on:
workflow_call:

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Pull latest version tag
run: |
git fetch
git pull
LATEST_TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
echo "LATEST_TAG=$LATEST_TAG" >> $GITHUB_ENV
echo "LATEST_VERSION=${LATEST_TAG:1}" >> $GITHUB_ENV

- name: Retrieve build items
uses: actions/cache@v3
id: build-dotnet-cache
with:
path: ./**/Release/*.nupkg
key: build-dotnet-cache-${{ github.sha }}

- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.LATEST_TAG }}
name: ${{ env.LATEST_VERSION }}
token: ${{ secrets.BOT_PAT }}
generate_release_notes: true
files: |
LICENSE
# other files will be appended during/after publish
41 changes: 41 additions & 0 deletions .github/workflows/test-dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Test .NET

on:
pull_request:
branches: [ main ]
paths-ignore:
- '.github/**'
- '**/*.md'
- 'assets/**'
- 'deployments/**'
workflow_call:

env:
SOLUTION: ./ServerlessWorkflow.Sdk.sln

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: ['8.0.x' ]

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup .NET ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v2
with:
dotnet-version: ${{ matrix.dotnet-version }}

- name: Restore dependencies
run: dotnet restore "${{ env.SOLUTION }}"

# - name: Test
# run: dotnet test "${{ env.SOLUTION }}" --no-restore --verbosity normal"

# Test "per domain" for ease of readability
- name: Test Core
run: dotnet test "${{ env.SOLUTION }}" --no-restore --filter "FullyQualifiedName~Cases.Core"
# ...
28 changes: 28 additions & 0 deletions .github/workflows/versioning.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Auto Versioning .NET

on:
workflow_call:

jobs:
increment-version:
runs-on: windows-latest

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.BOT_PAT }}

- name: Reset Origin
run: |
git remote set-url origin "https://${{ secrets.BOT_USERNAME }}:${{ secrets.BOT_PAT }}@github.com/${{ github.repository }}.git"
git checkout ${{ github.ref_name }}

- name: Install Versioning.NET
run: |
dotnet tool install --global Versioning.NET

- name: Increment Version
run: |
dotnet-version increment-version-with-git-hints -g "." --branch-name ${{ github.ref_name }} --author-email ${{ secrets.BOT_EMAIL }}
Loading
Loading