diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..6a8e29a --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,70 @@ +on: + push: + tags: + - '*' + +jobs: + publish: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up JDK + uses: actions/setup-java@v2 + with: + distribution: 'adopt' + java-version: '11' + + - name: Cache SBT dependencies + uses: actions/cache@v2 + with: + path: | + ~/.sbt + ~/.ivy2 + key: ${{ runner.os }}-sbt-${{ hashFiles('**/*.sbt', '**/project/build.properties') }} + restore-keys: | + ${{ runner.os }}-sbt- + + - name: Build Scala Native artifacts + run: sbt nativeLink + + - name: Create release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false + + - name: Install Scalafmt + run: | + mv target/scala-3.3.1/sail-out target/scala-3.3.1/sail + + - name: Upload Binary + id: upload-artifacts + uses: actions/upload-artifact@v2 + with: + name: sail + path: target/scala-3.3.1/sail + + - name: Set release information + uses: actions/github-script@v4 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + script: | + const artifactPath = '${{ steps.upload-artifacts.outputs.artifact_path }}'; + const releaseId = '${{ steps.create_release.outputs.id }}'; + const octokit = require('@octokit/rest')(); + octokit.repos.uploadReleaseAsset({ + owner: context.repo.owner, + repo: context.repo.repo, + release_id: releaseId, + name: 'sail', + data: require('fs').readFileSync(artifactPath), + }); \ No newline at end of file diff --git a/src/main/scala/sail/main.scala b/src/main/scala/sail/main.scala index e0c08c4..80a6e01 100644 --- a/src/main/scala/sail/main.scala +++ b/src/main/scala/sail/main.scala @@ -28,6 +28,8 @@ def showBoolean(expr: BooleanExpr): String = expr match case BooleanExpr.True => "true" case BooleanExpr.False => "false" + case BooleanExpr.Not(e) => s"not(${show(e)})" + case BooleanExpr.Eq(l, r) => s"${show(l)} == ${show(r)}" case BooleanExpr.And(l, r) => s"${show(l)} and ${show(r)}" case BooleanExpr.Or(l, r) => s"${show(l)} or ${show(r)}"