Update sbt-ci-release to 1.9.0 #114
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: ["main"] | |
tags: ["v*"] | |
pull_request: | |
branches: ["*"] | |
env: | |
SN_RELEASE: fast | |
jobs: | |
unix_build: | |
name: Unix build on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-latest, ubuntu-latest] | |
include: | |
- os: macOS-latest | |
uploaded_filename: sn-demangler-x86_64-apple-darwin | |
llvm_bin_path: /usr/local/opt/llvm@13/bin | |
- os: ubuntu-latest | |
uploaded_filename: sn-demangler-x86_64-pc-linux | |
llvm_bin_path: /usr/lib/llvm-13/bin | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
cache: 'sbt' | |
- name: Setup Unix-like | |
run: ./.github/setup_unix.sh | |
- name: Test and build binary | |
run: sbt --client "test; buildNativeBinary" | |
env: | |
LLVM_BIN: ${{ matrix.llvm_bin_path }} | |
- uses: actions/upload-artifact@master | |
with: | |
path: bin/demangler | |
name: ${{ matrix.uploaded_filename }} | |
windows_build: | |
name: Windows build | |
strategy: | |
fail-fast: false | |
runs-on: windows-2022 | |
env: | |
LLVM_BIN: C:\Program Files\LLVM\bin | |
LLVM_VERSION: "13.0.1" | |
steps: | |
# This step is important to make sure scalafmt | |
# checks don't fail | |
- name: Setup git config | |
run: git config --global core.autocrlf false | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
cache: 'sbt' | |
# See https://github.com/scala-native/scala-native/blob/master/.github/actions/windows-setup-env/action.yml#L14 | |
# for details | |
- name: Configure Pagefile | |
uses: al-cheb/[email protected] | |
with: | |
minimum-size: 4GB | |
maximum-size: 16GB | |
- name: Install clang | |
shell: pwsh | |
run: | | |
choco install llvm --version="$Env:LLVM_VERSION" --allow-downgrade | |
choco install sbt --version=1.7.1 | |
clang --version | |
- name: CI (windows) | |
run: sbt test buildNativeBinary | |
shell: cmd | |
- name: Upload artifacts | |
uses: actions/upload-artifact@master | |
with: | |
path: bin/demangler.exe | |
name: sn-demangler-x86_64-pc-win32 | |
if-no-files-found: error | |
release: | |
needs: [unix_build, windows_build] | |
name: Release | |
if: startsWith(github.ref, 'refs/tags/v') || (github.ref == 'refs/heads/main') | |
runs-on: ubuntu-latest | |
env: | |
BINARIES: binaries/ | |
LLVM_BIN: /usr/lib/llvm-13/bin | |
LLVM_VERSION: 13 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
cache: 'sbt' | |
- name: Download binaries | |
uses: actions/download-artifact@v3 | |
id: download | |
with: | |
path: binaries | |
- name: Setup Unix-like | |
run: ./.github/setup_unix.sh | |
- name: Publish | |
run: | | |
sbt ci-release | |
env: | |
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} | |
PGP_SECRET: ${{ secrets.PGP_SECRET }} | |
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
- name: Rename binaries | |
run: | | |
cd "${{steps.download.outputs.download-path}}" | |
mv sn-demangler-x86_64-apple-darwin sn-demangler-x86_64-apple-darwin-dir | |
mv sn-demangler-x86_64-apple-darwin-dir/demangler sn-demangler-x86_64-apple-darwin | |
mv sn-demangler-x86_64-pc-linux sn-demangler-x86_64-pc-linux-dir | |
mv sn-demangler-x86_64-pc-linux-dir/demangler sn-demangler-x86_64-pc-linux | |
mv sn-demangler-x86_64-pc-win32 sn-demangler-x86_64-pc-win32-dir | |
mv sn-demangler-x86_64-pc-win32-dir/demangler.exe sn-demangler-x86_64-pc-win32.exe | |
- name: Upload release binaries | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: "${{steps.download.outputs.download-path}}/**/*" |