-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build and release with GitHub Actions for macOS, Linux, and Windows.
- Loading branch information
1 parent
2decef6
commit ac2d478
Showing
5 changed files
with
123 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
name: Continuous Integration | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- cicd | ||
tags: | ||
- '*' | ||
pull_request: | ||
branches: | ||
- master | ||
jobs: | ||
build: | ||
name: sbt assembly | ||
runs-on: ubuntu-latest | ||
container: | ||
image: eed3si9n/sbt:jdk11-alpine | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: sbt assembly | ||
run: sbt 'set assemblyOutputPath in assembly := new File("./target/soctool.jar")' assembly | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
path: target/soctool.jar | ||
|
||
release_jar: | ||
name: jar-image | ||
if: startsWith(github.ref, 'refs/tags/') | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
path: ./ | ||
- name: Create GitHub release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: 'artifact/soctool.jar' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
release_nix: | ||
name: native-image-nix | ||
if: startsWith(github.ref, 'refs/tags/') | ||
needs: build | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-18.04, macos-10.15] | ||
steps: | ||
- uses: DeLaGuardo/setup-graalvm@3 | ||
with: | ||
graalvm-version: '20.0.0.java11' | ||
|
||
- name: Install GraalVM's native-image extension | ||
run: gu install native-image | ||
|
||
- uses: actions/download-artifact@v2 | ||
with: | ||
path: ./ | ||
|
||
- name: Create native soctool | ||
run: native-image --verbose -jar ./artifact/soctool.jar soctool | ||
|
||
- name: Create tarball | ||
run: tar -zcvf "soctool-${{ matrix.os }}.tar.gz" soctool | ||
|
||
# Even though this is in a matrix, it'll be idempotent | ||
- name: Create GitHub release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: 'soctool-${{ matrix.os }}.tar.gz' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
release_win: | ||
name: native-image-win | ||
if: startsWith(github.ref, 'refs/tags/') | ||
needs: build | ||
runs-on: windows-2019 | ||
steps: | ||
- uses: DeLaGuardo/setup-graalvm@3 | ||
with: | ||
graalvm-version: '20.0.0.java11' | ||
|
||
- name: Install GraalVM's native-image extension | ||
run: ${{ env.JAVA_HOME }}\bin\gu.cmd install native-image | ||
|
||
- uses: actions/download-artifact@v2 | ||
with: | ||
path: ./ | ||
|
||
- name: Create native soctool | ||
run: >- | ||
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" && | ||
${{ env.JAVA_HOME }}\bin\native-image.cmd --verbose -jar .\artifact\soctool.jar soctool | ||
shell: cmd | ||
|
||
- name: Create zip | ||
run: 7z a soctool-windows.zip soctool.exe | ||
|
||
- name: Create GitHub release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: 'soctool-windows.zip' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM oracle/graalvm-ce:20.0.0-java11 | ||
|
||
# install native-image | ||
RUN gu install native-image | ||
|
||
# work dir on /opt/workspace | ||
WORKDIR /opt/workspace | ||
|
||
# run native-image | ||
ENTRYPOINT ["native-image"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Get SBT / Scala build env image and run assembly (compile soctool to a fat JAR) | ||
docker run --mount src="$(pwd)",target=/opt/workspace,type=bind eed3si9n/sbt:jdk11-alpine \ | ||
'set assemblyOutputPath in assembly := new File("./target/soctool.jar")' \ | ||
assembly |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
sbt.version = 1.2.8 | ||
sbt.version = 1.3.9 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.10") |