Skip to content

Commit

Permalink
add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
vbergeron-ledger committed Nov 20, 2023
1 parent f307b03 commit a0be517
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -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),
});
2 changes: 2 additions & 0 deletions src/main/scala/sail/main.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)}"

Expand Down

0 comments on commit a0be517

Please sign in to comment.