Skip to content

Commit

Permalink
sleep a little before emitting "ready" event.
Browse files Browse the repository at this point in the history
otherwise the IO dispatcher will not catch it in time and it will not me emitted to stdout.
  • Loading branch information
fiatjaf committed Jun 29, 2022
1 parent a458301 commit a6ed118
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 13 deletions.
67 changes: 55 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build
name: Build and Release
on:
push:
tags:
Expand All @@ -8,7 +8,7 @@ permissions:
contents: write

jobs:
build:
build-jar:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -17,28 +17,71 @@ jobs:
java-version: '11'
distribution: 'temurin'
cache: 'sbt'
- uses: rinx/setup-graalvm-ce@v0.0.5
with:
graalvm-version: "22.1.0"
java-version: "java11"
native-image: "true"
- run: sbt assembly
- run: sbt nativeImage
- run: mv target/scala-2.13/cliche-assembly*.jar target/scala-2.13/cliche.jar
- uses: actions/upload-artifact@v3
with:
name: cliche.bin
name: cliche.jar
path: target/scala-2.13/cliche.jar

build-linux-native-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: 'sbt'
- run: GRAALVM_HOME=$GRAALVM_11_ROOT sbt nativeImage
- uses: actions/upload-artifact@v3
with:
name: cliche-linux.bin
path: target/native-image/cliche

build-mac-native-image:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: 'sbt'
- run: $GRAALVM_11_ROOT/gu install native-image
- run: GRAALVM_HOME=$GRAALVM_11_ROOT/../ sbt nativeImage
- uses: actions/upload-artifact@v3
with:
name: cliche-mac.bin
path: target/native-image/cliche

release:
runs-on: ubuntu-latest
needs:
- build-jar
- build-linux-native-image
- build-mac-native-image
steps:
- run: mkdir ~/download
- uses: actions/download-artifact@v3
with:
name: cliche.jar
path: target/scala-2.13/cliche.jar
path: ~/download/
- uses: actions/download-artifact@v3
with:
name: cliche-linux.bin
path: ~/download/
- uses: actions/download-artifact@v3
with:
name: cliche-mac.bin
path: ~/download/
- uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
prerelease: false
automatic_release_tag: ${{ github.ref }}
title: ${{ github.ref_name }}
files: |
./target/native-image/cliche
./target/scala-2.13/cliche.jar
~/download/cliche-linux.bin
~/download/cliche-mac.bin
~/download/cliche.jar
4 changes: 3 additions & 1 deletion src/main/scala/Main.scala
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,9 @@ object Main extends IOApp.Simple {
for {
_ <- IO.delay {
dispatcher.unsafeRunAndForget(
topic.publish1(Commands.onReady()) >> IO.unit
IO.sleep(FiniteDuration(3, "seconds")) >> topic.publish1(
Commands.onReady()
) >> IO.unit
)
LNParams.cm.localPaymentListeners += new OutgoingPaymentListener {
override def wholePaymentFailed(
Expand Down

0 comments on commit a6ed118

Please sign in to comment.