Added namespace inference for calling functions where the subject typ… #66
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: Remote Build | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
workflow_dispatch: | |
inputs: | |
fullName: | |
description: The full name of the release | |
default: Adept 3.0 | |
required: true | |
type: string | |
shortVersion: | |
description: The short version number | |
default: "3.0" | |
required: true | |
type: string | |
longVersion: | |
description: The long version number | |
default: "3.0.0" | |
required: true | |
type: string | |
alternativeBinaryName: | |
description: The alternative binary name | |
default: "adept3-0" | |
required: true | |
type: string | |
env: | |
BUILD_TYPE: Release | |
IS_GITHUB_WORKFLOW: On | |
jobs: | |
build: | |
runs-on: ${{matrix.os}} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [windows-latest, macos-latest, ubuntu-latest] | |
defaults: | |
run: | |
working-directory: ${{github.workspace}} | |
name: ${{ format('Build / {0}', matrix.os) }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Configure to use MinGW-w64 (Windows) | |
if: matrix.os == 'windows-latest' | |
shell: bash | |
run: | | |
export CC=x86_64-w64-mingw32-gcc | |
export CXX=x86_64-w64-mingw32-g++ | |
- name: Install latest Rust nightly | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly | |
target: x86_64-pc-windows-gnu | |
override: true | |
components: clippy | |
- name: Install LLVM and dependencies (Windows) | |
if: ${{ matrix.os == 'windows-latest' }} | |
run: | | |
C:\msys64\usr\bin\pacman -S mingw-w64-x86_64-gcc --noconfirm | |
C:\msys64\usr\bin\pacman -S mingw-w64-x86_64-llvm --noconfirm | |
C:\msys64\usr\bin\pacman -S mingw-w64-x86_64-zlib --noconfirm | |
C:\msys64\usr\bin\pacman -S mingw-w64-x86_64-zstd --noconfirm | |
- name: Install LLVM and dependencies (macOS) | |
if: ${{ matrix.os == 'macos-latest' }} | |
run: | | |
brew install llvm # For clang | |
brew install llvm@18 | |
brew install zstd | |
- name: Install LLVM and dependencies (Ubuntu) | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
run: | | |
sudo apt-get update | |
sudo apt-get remove -y llvm | |
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" | |
brew install llvm@18 | |
brew install zstd | |
- name: Build (Windows) | |
if: ${{ matrix.os == 'windows-latest' }} | |
run: | | |
cargo build --release --target x86_64-pc-windows-gnu | |
env: | |
CFLAGS: -static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lpthread | |
CXXFLAGS: -static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lpthread | |
LLVM_SYS_181_PREFIX: C:\msys64\mingw64 | |
zstd_DIR: C:\msys64\mingw64 | |
zstd_LIBRARY: C:\msys64\mingw64\lib\libzstd.a | |
ZLIB_INCLUDE_DIR: C:\msys64\mingw64\include | |
ZLIB_LIBRARY: C:\msys64\mingw64\lib\libz.a | |
- name: Build (macOS) | |
if: ${{ matrix.os == 'macos-latest' }} | |
run: | | |
cargo build --release | |
env: | |
CC: /opt/homebrew/opt/llvm/bin/clang | |
LLVM_SYS_181_PREFIX: /opt/homebrew/opt/llvm@18 | |
zstd_DIR: /usr/local/opt/zstd | |
CFLAGS: -static-libstdc++ | |
CXXFLAGS: -static-libstdc++ | |
LDFLAGS: /opt/homebrew/opt/llvm/lib/libunwind.a | |
- name: Build (Ubuntu) | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
run: | | |
cargo build --release | |
env: | |
LLVM_SYS_181_PREFIX: /home/linuxbrew/.linuxbrew/opt/llvm@18 | |
zstd_DIR: /home/linuxbrew/.linuxbrew/opt/zstd | |
- name: Archive Build Result (Windows) | |
if: ${{ matrix.os == 'windows-latest' }} | |
uses: a7ul/[email protected] | |
with: | |
command: c | |
cwd: target/x86_64-pc-windows-gnu/release | |
files: adept.exe | |
outPath: ${{github.workspace}}/build-${{ matrix.os }}.tar.gz | |
- name: Archive Build Result (macOS / Linux) | |
if: ${{ matrix.os != 'windows-latest' }} | |
uses: a7ul/[email protected] | |
with: | |
command: c | |
cwd: target/release | |
files: adept | |
outPath: ${{github.workspace}}/build-${{ matrix.os }}.tar.gz | |
- name: Upload Build Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: build-${{ matrix.os }}-archive | |
path: build-${{ matrix.os }}.tar.gz | |
test: | |
needs: build | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [windows-latest, macos-latest, ubuntu-latest] | |
name: ${{ format('Test / {0}', matrix.os) }} | |
steps: | |
- name: Download Build Artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: build-${{ matrix.os }}-archive | |
- name: Unpack Build Artifact | |
uses: a7ul/[email protected] | |
with: | |
command: x | |
files: build-${{ matrix.os }}.tar.gz | |
deploy: | |
name: Deploy | |
needs: [test] | |
runs-on: ubuntu-latest | |
if: ${{ github.event_name == 'push' }} | |
steps: | |
- name: Get workflow dispatch inputs (workflow dispatch) | |
if: github.event_name == 'workflow_dispatch' | |
shell: bash | |
run: | | |
echo 'fullName=${{github.event.inputs.fullName}}' >> $GITHUB_ENV | |
echo 'shortVersion=${{github.event.inputs.shortVersion}}' >> $GITHUB_ENV | |
echo 'longVersion=${{github.event.inputs.longVersion}}' >> $GITHUB_ENV | |
echo 'alternativeBinaryName=${{github.event.inputs.alternativeBinaryName}}' >> $GITHUB_ENV | |
echo 'releaseName=${{github.event.inputs.fullName}}' >> $GITHUB_ENV | |
echo 'releaseTagName=v${{github.event.inputs.shortVersion}}' >> $GITHUB_ENV | |
- name: Get default inputs (push / pr) | |
if: github.event_name != 'workflow_dispatch' | |
shell: bash | |
run: | | |
echo 'fullName=Adept Nightly' >> $GITHUB_ENV | |
echo 'shortVersion=nightly' >> $GITHUB_ENV | |
echo 'longVersion=nightly' >> $GITHUB_ENV | |
echo 'alternativeBinaryName=adept-nightly' >> $GITHUB_ENV | |
echo 'releaseName=Nightly' >> $GITHUB_ENV | |
echo 'releaseTagName=Nightly' >> $GITHUB_ENV | |
- name: Download Build Artifact (windows-latest) | |
uses: actions/download-artifact@v3 | |
with: | |
name: build-windows-latest-archive | |
- name: Download Build Artifact (macos-latest) | |
uses: actions/download-artifact@v3 | |
with: | |
name: build-macos-latest-archive | |
- name: Download Build Artifact (ubuntu-latest) | |
uses: actions/download-artifact@v3 | |
with: | |
name: build-ubuntu-latest-archive | |
- name: Get current date | |
id: date | |
run: echo "::set-output name=date::$(date '+%B %d %Y at %l:%M %p %Z')" | |
- name: Release | |
uses: IsaacShelton/[email protected] | |
with: | |
token: ${{secrets.GITHUB_TOKEN}} | |
release: ${{env.releaseName}} | |
body: ${{ format('Last built on {0} - {1}', steps.date.outputs.date, github.sha) }} | |
tag: ${{env.releaseTagName}} | |
replace: true | |
files: > | |
build-windows-latest.tar.gz | |
build-macos-latest.tar.gz | |
build-ubuntu-latest.tar.gz |