Skip to content

Remove std llvm ref files (#317) #277

Remove std llvm ref files (#317)

Remove std llvm ref files (#317) #277

Workflow file for this run

# Publish Spice
name: Release
on:
push:
tags:
- '*'
jobs:
build-compiler-linux:
name: Build compiler binaries - Linux
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 11
- name: Setup latest GCC and build dependencies
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa
sudo apt update
sudo apt install gcc-13 g++-13
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 110 --slave /usr/bin/g++ g++ /usr/bin/g++-13 --slave /usr/bin/gcov gcov /usr/bin/gcov-13 --slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-13 --slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-13
- name: Setup Ninja
run: sudo apt-get install ninja-build
- name: Setup Mold
uses: rui314/setup-mold@v1
- name: Setup CCache
uses: hendrikmuhs/ccache-action@v1
- name: Cache LLVM
id: cache-llvm
uses: actions/cache@v3
with:
path: /home/runner/work/spice/spice/llvm
key: llvm-17.0.0-rc4-linux-x64
- name: Setup LLVM
if: steps.cache-llvm.outputs.cache-hit != 'true'
run: |
git clone --depth 1 --branch llvmorg-17.0.0-rc4 https://github.com/llvm/llvm-project.git llvm
mkdir ./llvm/build
cd ./llvm/build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_CXX_FLAGS_RELEASE="-O2" -DLLVM_ENABLE_RTTI=ON -GNinja -Wno-dev -Wattributes ../llvm
cmake --build . -j$(nproc)
- name: Download Libs
run: |
chmod +x setup-libs.sh
./setup-libs.sh
- name: Configure & compile project
env:
LLVM_DIR: /home/runner/work/spice/spice/llvm/build/lib/cmake/llvm
run: |
mkdir ./bin
cd ./bin
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DSPICE_LINK_STATIC=ON -DSPICE_LTO=ON -DCMAKE_CXX_FLAGS_RELEASE="-O2" -DSPICE_VERSION="${{ github.ref_name }}" -DSPICE_BUILT_BY="ghactions" ..
cmake --build . --target spice -j$(nproc)
- name: Process build output
working-directory: bin
run: |
mv ./src/spice spice
chmod +x spice
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: spice-linux-x64
path: ./bin/spice**
build-compiler-windows:
name: Build compiler binaries - Windows
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 11
- name: Setup latest GCC
shell: pwsh
run: |
choco uninstall mingw --all-versions
choco uninstall llvm --all-versions
Remove-Item -Recurse -Force C:/Strawberry
echo "Uninstalling done."
Invoke-WebRequest https://chillibits.com/files/gh/mingw64_13_2_0.7z -OutFile mingw64.7z
echo "Downloading done."
7z x mingw64.7z -oC:\mingw64
echo "Unpacking done."
Copy-Item -Path C:\mingw64\mingw64\bin\mingw32-make.exe -Destination C:\mingw64\mingw64\bin\make.exe
echo "All done."
- name: Setup Ninja
uses: seanmiddleditch/gha-setup-ninja@master
- name: Setup CCache
uses: hendrikmuhs/ccache-action@v1
- name: Cache LLVM
id: cache-llvm
uses: actions/cache@v3
with:
path: D:/a/spice/spice/llvm
key: llvm-17.0.0-rc4-win-x64
- name: Setup LLVM
if: steps.cache-llvm.outputs.cache-hit != 'true'
run: |
git clone --depth 1 --branch llvmorg-17.0.0-rc4 https://github.com/llvm/llvm-project.git llvm
setx /M PATH "%PATH%;C:\mingw64\mingw64\bin"
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
echo "Adding MinGW to path done."
mkdir ./llvm/build
cd ./llvm/build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_CXX_FLAGS_RELEASE="-O2" -DLLVM_ENABLE_RTTI=ON -GNinja -Wno-dev -Wattributes ../llvm
cmake --build . -j 4
- name: Download Libs
run: .\setup-libs.bat
- name: Configure & compile project
env:
LLVM_DIR: D:/a/spice/spice/llvm/build/lib/cmake/llvm
run: |
setx /M PATH "%PATH%;C:\mingw64\mingw64\bin"
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
echo "Adding MinGW to path done."
mkdir ./bin
cd ./bin
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DSPICE_LINK_STATIC=ON -DCMAKE_CXX_FLAGS_RELEASE="-O2" -DSPICE_VERSION="${{ github.ref_name }}" -DSPICE_BUILT_BY="ghactions" ..
cmake --build . --target spice -j 4
- name: Process build output
working-directory: bin
run: mv ./src/spice.exe spice.exe
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: spice-windows-static-x64
path: ./bin/spice**
build-artifacts:
name: Build artifacts
needs: [ build-compiler-linux, build-compiler-windows ]
runs-on: ubuntu-latest
env:
DOCKER_CLI_EXPERIMENTAL: enabled
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Restore Go modules cache
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-
- name: Docker login GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
- name: Docker login Docker Hub
uses: docker/login-action@v2
with:
registry: docker.io
username: chillibits
password: ${{ secrets.DOCKER_HUB_SECRET }}
- name: Download all artifacts of compiler build
uses: actions/download-artifact@v3
with:
path: bin
- name: Rename compiler binaries & allow execution
working-directory: bin
run: |
mv spice-windows-static-x64 spice-windows-amd64
mv spice-linux-x64 spice-linux-amd64
chmod -R +x ./
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
version: v1.20.0
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifact@v3
with:
name: dist-output
path: dist/
deploy-nexus:
name: Deploy to Nexus
needs: build-artifacts
runs-on: ubuntu-latest
if: contains(github.ref, 'rc') == false
strategy:
matrix:
arch:
- amd64
#- 386
#- arm64
steps:
- name: Download dist output
uses: actions/download-artifact@v3
with:
name: dist-output
- name: Deploy to Debian / Raspbian repo
run: |
curl -sSf -u "${{ secrets.NEXUS_USERNAME }}:${{ secrets.NEXUS_PASSWORD }}" -H "Content-Type: multipart/form-data" --data-binary "@./spice_${{ matrix.arch }}.deb" "${{ secrets.NEXUS_URL }}/debian-bookworm/"
curl -sSf -u "${{ secrets.NEXUS_USERNAME }}:${{ secrets.NEXUS_PASSWORD }}" -H "Content-Type: multipart/form-data" --data-binary "@./spice_${{ matrix.arch }}.deb" "${{ secrets.NEXUS_URL }}/debian-bullseye/"
curl -sSf -u "${{ secrets.NEXUS_USERNAME }}:${{ secrets.NEXUS_PASSWORD }}" -H "Content-Type: multipart/form-data" --data-binary "@./spice_${{ matrix.arch }}.deb" "${{ secrets.NEXUS_URL }}/debian-buster/"
curl -sSf -u "${{ secrets.NEXUS_USERNAME }}:${{ secrets.NEXUS_PASSWORD }}" -H "Content-Type: multipart/form-data" --data-binary "@./spice_${{ matrix.arch }}.deb" "${{ secrets.NEXUS_URL }}/debian-stretch/"
curl -sSf -u "${{ secrets.NEXUS_USERNAME }}:${{ secrets.NEXUS_PASSWORD }}" -H "Content-Type: multipart/form-data" --data-binary "@./spice_${{ matrix.arch }}.deb" "${{ secrets.NEXUS_URL }}/debian-jessie/"
curl -sSf -u "${{ secrets.NEXUS_USERNAME }}:${{ secrets.NEXUS_PASSWORD }}" -H "Content-Type: multipart/form-data" --data-binary "@./spice_${{ matrix.arch }}.deb" "${{ secrets.NEXUS_URL }}/debian-wheezy/"
- name: Deploy to Ubuntu repo
run: |
curl -sSf -u "${{ secrets.NEXUS_USERNAME }}:${{ secrets.NEXUS_PASSWORD }}" -H "Content-Type: multipart/form-data" --data-binary "@./spice_${{ matrix.arch }}.deb" "${{ secrets.NEXUS_URL }}/ubuntu-hirsute/"
curl -sSf -u "${{ secrets.NEXUS_USERNAME }}:${{ secrets.NEXUS_PASSWORD }}" -H "Content-Type: multipart/form-data" --data-binary "@./spice_${{ matrix.arch }}.deb" "${{ secrets.NEXUS_URL }}/ubuntu-groovy/"
curl -sSf -u "${{ secrets.NEXUS_USERNAME }}:${{ secrets.NEXUS_PASSWORD }}" -H "Content-Type: multipart/form-data" --data-binary "@./spice_${{ matrix.arch }}.deb" "${{ secrets.NEXUS_URL }}/ubuntu-focal/"
curl -sSf -u "${{ secrets.NEXUS_USERNAME }}:${{ secrets.NEXUS_PASSWORD }}" -H "Content-Type: multipart/form-data" --data-binary "@./spice_${{ matrix.arch }}.deb" "${{ secrets.NEXUS_URL }}/ubuntu-bionic/"
curl -sSf -u "${{ secrets.NEXUS_USERNAME }}:${{ secrets.NEXUS_PASSWORD }}" -H "Content-Type: multipart/form-data" --data-binary "@./spice_${{ matrix.arch }}.deb" "${{ secrets.NEXUS_URL }}/ubuntu-xenial/"
curl -sSf -u "${{ secrets.NEXUS_USERNAME }}:${{ secrets.NEXUS_PASSWORD }}" -H "Content-Type: multipart/form-data" --data-binary "@./spice_${{ matrix.arch }}.deb" "${{ secrets.NEXUS_URL }}/ubuntu-trusty/"
curl -sSf -u "${{ secrets.NEXUS_USERNAME }}:${{ secrets.NEXUS_PASSWORD }}" -H "Content-Type: multipart/form-data" --data-binary "@./spice_${{ matrix.arch }}.deb" "${{ secrets.NEXUS_URL }}/ubuntu-jammy/"
- name: Deploy to CentOS repo
run: |
curl -sSf -u "${{ secrets.NEXUS_USERNAME }}:${{ secrets.NEXUS_PASSWORD }}" -H "Content-Type: multipart/form-data" --upload-file ./spice_${{ matrix.arch }}.rpm ${{ secrets.NEXUS_URL }}/centos/spice/${{ github.ref_name }}/spice-${{ matrix.arch }}.rpm
- name: Deploy to Fedora repo
run: |
curl -sSf -u "${{ secrets.NEXUS_USERNAME }}:${{ secrets.NEXUS_PASSWORD }}" -H "Content-Type: multipart/form-data" --upload-file ./spice_${{ matrix.arch }}.rpm ${{ secrets.NEXUS_URL }}/fedora/spice/${{ github.ref_name }}/spice-${{ matrix.arch }}.rpm
# - name: Deploy to Alpine repo
# run: |
# curl -sSf -u "${{ secrets.NEXUS_USERNAME }}:${{ secrets.NEXUS_PASSWORD }}" -H "Content-Type: multipart/form-data" --data-binary "@./spice_${{ matrix.arch }}.apk" "${{ secrets.NEXUS_URL }}/alpine/spice/${{ github.ref_name }}/spice-${{ matrix.arch }}.apk"
build-win-installers:
name: Build Windows installers
needs: build-artifacts
runs-on: windows-latest
strategy:
matrix:
config:
- {
arch: amd64,
label: x64
}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install GoMSI
run: choco install -y go-msi
- name: Download executables
id: download_exe
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
hub release download "${GITHUB_REF#refs/tags/}" -i '*windows_${{ matrix.config.arch }}*.zip'
printf "::set-output name=zip::%s\n" *.zip
unzip -o *.zip && rm -v *.zip
dir
- name: Prepare PATH
shell: bash
run: |
echo "$WIX\\bin" >> $GITHUB_PATH
echo "C:\\Program Files\\go-msi" >> $GITHUB_PATH
- name: Copy DLLs to source dir
shell: bash
env:
ZIP_FILE: ${{ steps.download_exe.outputs.zip }}
run: cp ./src/thirdparty/zlib1__.dll ./
- name: Build MSI
shell: bash
id: build_msi
env:
ZIP_FILE: ${{ steps.download_exe.outputs.zip }}
run: |
mkdir -p build
msi="$(basename "$ZIP_FILE" ".zip").msi"
printf "::set-output name=msi::%s\n" "$msi"
go-msi make --msi "$PWD/$msi" --out "$PWD/build" --version ${{ github.ref_name }}
printf "::set-output name=msi::%s\n" *.msi
- name: Upload MSI
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ steps.build_msi.outputs.msi }}
asset_name: spice_${{ matrix.config.label }}_setup.msi
tag: ${{ github.ref }}
- name: Deploy to WinGet
uses: vedantmgoyal2009/winget-releaser@v2
with:
identifier: ChilliBits.Spice
version: ${{ github.ref_name }}
release-tag: ${{ github.ref_name }}
token: ${{ secrets.CR_PAT }}