diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f96d346..31c4543 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: Build +name: Build and Release on: push: tags: @@ -8,7 +8,7 @@ permissions: contents: write jobs: - build: + build-jar: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -17,22 +17,64 @@ 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 }} @@ -40,5 +82,6 @@ jobs: 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 diff --git a/src/main/scala/Main.scala b/src/main/scala/Main.scala index cc298e0..4e4d301 100644 --- a/src/main/scala/Main.scala +++ b/src/main/scala/Main.scala @@ -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(