diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index a1989bb..c145664 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -17,36 +17,43 @@ jobs: uses: actions/checkout@v2 - name: Set up GraalVM - uses: DeLaGuardo/setup-graalvm@v4 + uses: graalvm/setup-graalvm@v1 with: version: 'latest' java-version: '21' - - name: Install Native Image tool - run: gu install native-image - - name: Build jar with Gradle - run: ./gradlew build + run: | + cd tahini + ./gradlew build - name: Compile native image - run: native-image -jar app/build/libs/tahini.jar tahini + run: | + cd tahini + native-image -jar app/build/libs/app.jar tahini - name: Upload binary - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: tahini-${{ matrix.os }} - path: tahini* + path: tahini release: needs: build runs-on: ubuntu-latest steps: + - name: Download binaries + uses: actions/download-artifact@v4 + with: + name: tahini-${{ matrix.os }} + - name: List files + run: ls -l - name: Create Release uses: softprops/action-gh-release@v1 with: files: | - tahini-ubuntu-latest - tahini-macos-latest - tahini-windows-latest.exe + tahini-ubuntu-latest/tahini + tahini-macos-latest/tahini + tahini-windows-latest/tahini.exe env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} diff --git a/README.md b/README.md index 14ebf13..1d7ff6c 100644 --- a/README.md +++ b/README.md @@ -121,6 +121,8 @@ java -jar app/build/libs/app.jar "../test.tah" ### Variables +All variables in Tahini are dynamically typed, and you can declare them using the `var` keyword. Variables can be reassigned, and their scope is determined by the block in which they are declared. + ``` var a = "global a"; { diff --git a/test.tah b/test.tah index 4a6c92e..75d85bc 100644 --- a/test.tah +++ b/test.tah @@ -1,5 +1,7 @@ // Fibonacci function -fun fib(n) { +fun fib(n) +precondition: n >= 0 +{ if (n <= 1) return n; return fib(n - 2) + fib(n - 1); } @@ -17,10 +19,3 @@ test "checking this out" { assertion: fib(4) == 3; assertion: fib(5) == 5; } - -// Test block that should fail -test "this should fail" { - assertion: fib(0) == 0; - assertion: fib(2) == 1222; // This will fail - assertion: fib(3) == 2; -}