-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Publish binary files for all platforms (#5)
- Loading branch information
1 parent
3125048
commit 82c13dc
Showing
6 changed files
with
84 additions
and
3 deletions.
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,26 @@ | ||
//> using scala "3.1.2" | ||
//> using lib "com.lihaoyi::os-lib:0.8.0" | ||
|
||
import scala.util.Properties | ||
|
||
val platformSuffix: String = { | ||
val os = | ||
if (Properties.isWin) "pc-win32" | ||
else if (Properties.isLinux) "pc-linux" | ||
else if (Properties.isMac) "apple-darwin" | ||
else sys.error(s"Unrecognized OS: ${sys.props("os.name")}") | ||
os | ||
} | ||
val artifactsPath = os.Path("artifacts", os.pwd) | ||
val destPath = | ||
if (Properties.isWin) artifactsPath / s"ulc-$platformSuffix.exe" | ||
else artifactsPath / s"ulc-$platformSuffix" | ||
val scalaCLILauncher = | ||
if (Properties.isWin) "scala-cli.bat" else "scala-cli" | ||
|
||
os.makeDir(artifactsPath) | ||
os.proc(scalaCLILauncher, "package", "./ulc", "-o", destPath, "--native-image") | ||
.call(cwd = os.pwd) | ||
.out | ||
.text() | ||
.trim |
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
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,36 @@ | ||
name: Publish | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
publish: | ||
name: Publish for ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
include: | ||
- os: ubuntu-latest | ||
artifact_name: ulc-pc-linux | ||
asset_name: ulc-linux | ||
- os: windows-latest | ||
artifact_name: ulc-pc-win32.exe | ||
asset_name: ulc-pc-win32.exe | ||
- os: macos-latest | ||
artifact_name: ulc-apple-darwin | ||
asset_name: ulc-apple | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: coursier/cache-action@v6.3 | ||
- uses: VirtusLab/scala-cli-setup@v0.1 | ||
- name: Package app | ||
run: scala-cli .github/scripts/package.sc | ||
- name: Upload binaries to release | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: ./artifacts/${{ matrix.artifact_name }} | ||
asset_name: ${{ matrix.asset_name }} | ||
tag: ${{ github.ref }} |
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,5 +1,6 @@ | ||
.bsp | ||
.metals | ||
.ammonite | ||
.npmrc | ||
.scala | ||
*.js | ||
|
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
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