Update Release workflows #357
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- '*' | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Caching dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.sbt | |
~/.ivy2 | |
key: scala-build-deps | |
- name: Building | |
run: sbt assembly | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: djinni-generator | |
path: target/bin/djinni | |
formatCheck: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Caching dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ~/.sbt | |
key: scala-fmt-deps | |
- name: "Format check generator" | |
run: sbt scalafmtCheck | |
- name: "Format check integration test" | |
run: sbt it:scalafmtCheck | |
it: | |
runs-on: ubuntu-latest | |
needs: [build, formatCheck] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Caching dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.sbt | |
~/.ivy2 | |
key: scala-build-deps | |
- uses: actions/download-artifact@v4 | |
with: | |
name: djinni-generator | |
path: target/bin | |
- name: Restoring file permissions of artifact | |
run: chmod u+x target/bin/djinni | |
- name: Running integration-tests | |
run: sbt IntegrationTest/test | |
buildWindows: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Caching dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.sbt | |
~/.ivy2 | |
key: scala-build-deps-windows | |
- name: Building | |
run: sbt assembly | |
- name: Testing | |
run: sbt IntegrationTest/test | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: djinni-generator.bat | |
path: target/bin/djinni.bat | |
publishPreRelease: | |
runs-on: ubuntu-latest | |
needs: [it, buildWindows] | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: djinni-generator | |
path: target/bin | |
- name: Restoring file permissions of artifact | |
run: chmod u+x target/bin/djinni | |
- name: Execute djinni-generator | |
run: target/bin/djinni --version | |
- name: Generate sha256sum | |
run: sha256sum target/bin/djinni > target/bin/djinni.sha256 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: djinni-generator.bat | |
path: target/bin | |
- name: Execute djinni-generator.bat | |
run: sh target/bin/djinni.bat --version | |
- name: Generate sha256sum | |
run: sha256sum target/bin/djinni.bat > target/bin/djinni.bat.sha256 | |
- uses: "marvinpinto/action-automatic-releases@latest" | |
with: | |
title: "Latest development build" | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
prerelease: true | |
automatic_release_tag: current-latest | |
files: | | |
target/bin/djinni | |
target/bin/djinni.sha256 | |
target/bin/djinni.bat | |
target/bin/djinni.bat.sha256 |