Skip to content

Commit

Permalink
allow setting the commmit ref
Browse files Browse the repository at this point in the history
  • Loading branch information
JssDWt committed Jul 27, 2023
1 parent 74ad8e2 commit 26d94ff
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 17 deletions.
18 changes: 17 additions & 1 deletion .github/workflows/build-all-platforms.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
name: Build all platforms
on:
workflow_call:
workflow_dispatch:
inputs:
ref:
description: 'commit/tag/branch reference'
required: true
type: string
workflow_call:
inputs:
ref:
description: 'commit/tag/branch reference'
required: true
type: string

jobs:
build-windows:
uses: ./.github/workflows/build-windows.yml
with:
ref: {{ inputs.ref }}
build-darwin:
uses: ./.github/workflows/build-darwin.yml
with:
ref: {{ inputs.ref }}
build-linux:
uses: ./.github/workflows/build-linux.yml
with:
ref: {{ inputs.ref }}
21 changes: 17 additions & 4 deletions .github/workflows/build-darwin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
name: Build Darwin
on:
workflow_dispatch:
inputs:
ref:
description: 'commit/tag/branch reference'
required: true
type: string
workflow_call:
inputs:
ref:
description: 'commit/tag/branch reference'
required: true
type: string

jobs:
build:
Expand All @@ -15,6 +26,8 @@ jobs:
steps:
- name: checkout
uses: actions/checkout@v3
with:
ref: ${{ inputs.ref }}

- name: Install rust toolchain
run: |
Expand All @@ -39,7 +52,7 @@ jobs:
- name: Archive release
uses: actions/upload-artifact@v3
with:
name: sdk-bindings-${{ github.sha }}-${{ matrix.target }}
name: sdk-bindings-${{ matrix.target }}
path: |
libs/target/${{ matrix.target }}/release/libbreez_sdk_bindings.dylib
libs/target/${{ matrix.target }}/release/libbreez_sdk_bindings.a
Expand All @@ -51,12 +64,12 @@ jobs:
steps:
- uses: actions/download-artifact@v3
with:
name: sdk-bindings-${{ github.sha }}-aarch64-apple-darwin
name: sdk-bindings-aarch64-apple-darwin
path: aarch64-apple-darwin

- uses: actions/download-artifact@v3
with:
name: sdk-bindings-${{ github.sha }}-x86_64-apple-darwin
name: sdk-bindings-x86_64-apple-darwin
path: x86_64-apple-darwin

- name: Build Darwin universal
Expand All @@ -68,7 +81,7 @@ jobs:
- name: Archive release
uses: actions/upload-artifact@v3
with:
name: sdk-bindings-${{ github.sha }}-darwin-universal
name: sdk-bindings-darwin-universal
path: |
darwin-universal/libbreez_sdk_bindings.dylib
darwin-universal/libbreez_sdk_bindings.a
15 changes: 14 additions & 1 deletion .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
name: Build Linux
on:
workflow_dispatch:
inputs:
ref:
description: 'commit/tag/branch reference'
required: true
type: string
workflow_call:
inputs:
ref:
description: 'commit/tag/branch reference'
required: true
type: string

jobs:
build:
Expand All @@ -15,6 +26,8 @@ jobs:
steps:
- name: checkout
uses: actions/checkout@v3
with:
ref: ${{ inputs.ref }}

- name: Install rust toolchain
run: |
Expand Down Expand Up @@ -47,5 +60,5 @@ jobs:
- name: Archive release
uses: actions/upload-artifact@v3
with:
name: sdk-bindings-${{ github.sha }}-${{ matrix.target }}
name: sdk-bindings-${{ matrix.target }}
path: libs/target/${{ matrix.target }}/release/libbreez_sdk_bindings.so
15 changes: 14 additions & 1 deletion .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
name: Build Windows
on:
workflow_dispatch:
inputs:
ref:
description: 'commit/tag/branch reference'
required: true
type: string
workflow_call:
inputs:
ref:
description: 'commit/tag/branch reference'
required: true
type: string

jobs:
build:
Expand All @@ -14,6 +25,8 @@ jobs:
steps:
- name: checkout
uses: actions/checkout@v3
with:
ref: ${{ inputs.ref }}

- name: Install rust toolchain
run: |
Expand Down Expand Up @@ -41,5 +54,5 @@ jobs:
- name: Archive release
uses: actions/upload-artifact@v3
with:
name: sdk-bindings-${{ github.sha }}-${{ matrix.target }}
name: sdk-bindings-${{ matrix.target }}
path: libs/target/${{ matrix.target }}/release/breez_sdk_bindings.dll
37 changes: 27 additions & 10 deletions .github/workflows/publish-csharp.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
name: Publish C# Bindings
on:
workflow_dispatch:
inputs:
ref:
description: 'commit/tag/branch reference'
required: true
type: string
package-version:
description: 'version for the nuget package (MAJOR.MINOR.BUILD)'
required: true
type: string
push:
branches:
- "build-artifacts-in-ci"
Expand All @@ -8,13 +18,17 @@ jobs:
build-all-platforms:
name: Build all platforms
uses: ./.github/workflows/build-all-platforms.yml
with:
ref: ${{ inputs.ref || github.sha }}

build-package:
needs: build-all-platforms
runs-on: ubuntu-latest
steps:
- name: Checkout breez-sdk repo
uses: actions/checkout@v3
with:
ref: ${{ inputs.ref || github.sha }}

- name: Install rust
run: |
Expand All @@ -29,32 +43,33 @@ jobs:
- uses: actions/download-artifact@v3
with:
name: sdk-bindings-${{ github.sha }}-aarch64-apple-darwin
name: sdk-bindings-aarch64-apple-darwin
path: libs/sdk-bindings/bindings-csharp/runtimes/osx-arm64/native

- uses: actions/download-artifact@v3
with:
name: sdk-bindings-${{ github.sha }}-x86_64-apple-darwin
name: sdk-bindings-x86_64-apple-darwin
path: libs/sdk-bindings/bindings-csharp/runtimes/osx-x64/native

- uses: actions/download-artifact@v3
with:
name: sdk-bindings-${{ github.sha }}-aarch64-unknown-linux-gnu
name: sdk-bindings-aarch64-unknown-linux-gnu
path: libs/sdk-bindings/bindings-csharp/runtimes/linux-arm64/native

- uses: actions/download-artifact@v3
with:
name: sdk-bindings-${{ github.sha }}-x86_64-unknown-linux-gnu
name: sdk-bindings-x86_64-unknown-linux-gnu
path: libs/sdk-bindings/bindings-csharp/runtimes/linux-x64/native

- uses: actions/download-artifact@v3
with:
name: sdk-bindings-${{ github.sha }}-x86_64-pc-windows-msvc
name: sdk-bindings-x86_64-pc-windows-msvc
path: libs/sdk-bindings/bindings-csharp/runtimes/win-x64/native

# - name: Update package version
# working-directory: libs/sdk-bindings/bindings-csharp
# run: sed -i.bak -e 's/<Version>.*<\/Version>/<Version>${{ inputs.version }}<\/Version>/' Breez.Sdk.csproj
- name: Update package version
if: ${{ inputs.package-version }}
working-directory: libs/sdk-bindings/bindings-csharp
run: sed -i.bak -e 's/<Version>.*<\/Version>/<Version>${{ inputs.package-version }}<\/Version>/' Breez.Sdk.csproj

- name: Setup dotnet
uses: actions/setup-dotnet@v3
Expand All @@ -72,7 +87,7 @@ jobs:
- name: Archive the package
uses: actions/upload-artifact@v3
with:
name: Breez.Sdk.${{ github.sha }}.nupkg
name: Breez.Sdk.${{ inputs.package-version || '0.0.1' }}.nupkg
path: libs/sdk-bindings/bindings-csharp/bin/Release/Breez.Sdk.*.nupkg

test-package:
Expand All @@ -88,10 +103,12 @@ jobs:
steps:
- name: Checkout breez-sdk repo
uses: actions/checkout@v3
with:
ref: ${{ inputs.ref || github.sha }}

- uses: actions/download-artifact@v3
with:
name: Breez.Sdk.${{ github.sha }}.nupkg
name: Breez.Sdk.${{ inputs.package-version }}.nupkg
path: libs/sdk-bindings/bindings-csharp/bin/Release

- name: Setup dotnet
Expand Down

0 comments on commit 26d94ff

Please sign in to comment.