Skip to content

Commit

Permalink
release things for github actions.
Browse files Browse the repository at this point in the history
  • Loading branch information
fiatjaf committed Jul 10, 2022
1 parent e4e8a48 commit 1837157
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 1 deletion.
12 changes: 12 additions & 0 deletions .github/workflows/fmt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: check if code is properly formatted
on: [push]

jobs:
scalafmt-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- name: run scalafmt
uses: stringbean/scalafmt-action@v2
69 changes: 69 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: build and release and upload assets
on:
push:
tags:
- '*'

permissions:
contents: write

jobs:
make-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}

build-x86:
runs-on: ubuntu-latest
needs:
- make-release
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: 'sbt'
- run: sudo apt install -y libsecp256k1-dev libuv1-dev
- run: sbt nativeLink
- run: mv target/scala-*/poncho-out poncho_x64
- uses: actions/upload-artifact@v3
with:
path: poncho_x64
name: poncho_x64
- uses: AButler/[email protected]
with:
files: poncho_x64
repo-token: ${{ secrets.GITHUB_TOKEN }}
release-tag: ${{ github.ref_name }}

build-arm:
runs-on: ubuntu-latest
needs:
- make-release
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: 'sbt'
- run: sudo apt install -y libsecp256k1-dev libuv1-dev
- run: cat build.sbt | sed 's/\/\/ _for-armv6_ //' > release.sbt && mv release.sbt build.sbt
- run: sbt nativeLink
- run: mv target/scala-*/poncho-out poncho_armv6
- uses: actions/upload-artifact@v3
with:
path: poncho_armv6
name: poncho_armv6
- uses: AButler/[email protected]
with:
files: poncho_armv6
repo-token: ${{ secrets.GITHUB_TOKEN }}
release-tag: ${{ github.ref_name }}
6 changes: 5 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ libraryDependencies ++= Seq(
"com.lihaoyi" %%% "upickle" % "1.6.0",
"com.lihaoyi" %%% "ujson" % "1.6.0",
"com.fiatjaf" %%% "sn-sha256" % "0.3.0",
"com.fiatjaf" %%% "sn-secp256k1" % "0.2.0-SNAPSHOT",
"com.fiatjaf" %%% "sn-secp256k1" % "0.2.0",
"com.fiatjaf" %%% "sn-chacha20poly1305" % "0.2.1",

"com.lihaoyi" %%% "utest" % "0.7.11" % Test
)
testFrameworks += new TestFramework("utest.runner.Framework")
nativeLinkStubs := true

// _for-release_ nativeMode := "release-full"
// _for-release_ nativeLTO := "thin"
// _for-armv6_ nativeConfig ~= { _.withTargetTriple("armv6-pc-linux-unknown") }

0 comments on commit 1837157

Please sign in to comment.