diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..102d8b0 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,65 @@ +name: Git Mkver Build + +# Trigger on every master branch push and pull request +on: + push: + branches: + - master + - patch-* + - ci-build + pull_request: + branches: + - master + +jobs: + + build: + + strategy: + matrix: + targetplatform: [x64] + + runs-on: windows-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 # avoid shallow clone so nbgv can do its work. + + # Install the .NET Core workload + - name: Install .NET Core + uses: actions/setup-dotnet@v3 + + - uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '19' + cache: 'sbt' + + - uses: graalvm/setup-graalvm@v1 + with: + version: '22.3.0' + java-version: '19' + components: 'native-image' + # github-token: ${{ secrets.GITHUB_TOKEN }} + native-image-job-reports: 'true' + + - name: Build with SBT + run: sbt assembly + + - name: Generate native image + run: | + cd target\scala-2.12 + $TEST = Get-ChildItem git-mkver-assembly-*.jar | Select-Object -ExpandProperty Name + native-image -jar $TEST --no-fallback + cd ..\..\ + + - name: Test Binary + run: target\scala-2.12\git-mkver-assembly-1.3.0.exe --help + + - name: Upload binary + uses: actions/upload-artifact@v2 + with: + name: git-mkver + path: target\scala-2.12\git-mkver-*.exe