Create Release with artifacts #42
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: Create Release with artifacts | |
on: | |
release: | |
types: [published] | |
jobs: | |
build-linux: | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup cmake | |
uses: jwlawson/[email protected] | |
with: | |
cmake-version: '3.25.2' | |
- name: Compile | |
run: | | |
sudo apt-get update | |
sudo apt-get remove libgd3 | |
sudo apt-get install curl libcurl4-openssl-dev libgd-dev libavif-dev libffi-dev -y | |
cmake -B . | |
cmake --build . -- -j 12 | |
- name: Create ZIP Archive | |
run: | | |
chmod +x blade/blade | |
zip -r9 --symlinks blade_linux.zip blade/ | |
- name: Generate Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: linux | |
path: blade_linux.zip | |
- name: Upload Artifact to Release | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: blade_linux.zip | |
asset_name: blade-linux-${{ github.event.release.tag_name }}.zip | |
asset_content_type: application/zip | |
build-macos: | |
runs-on: macos-latest | |
steps: | |
- name: Setup cmake | |
uses: jwlawson/[email protected] | |
with: | |
cmake-version: '3.25.2' | |
- uses: actions/checkout@v4 | |
- name: Setup dependencies | |
run: | | |
brew uninstall pkg-config --ignore-dependencies | |
brew install pkg-config gd libffi | |
- name: Compile | |
run: | | |
cmake -B . -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl | |
cmake --build . | |
- name: Create ZIP Archive | |
run: | | |
chmod 755 blade/blade | |
zip -r9 --symlinks blade_macos.zip blade/ | |
- name: Generate Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: macos | |
path: blade_macos.zip | |
- name: Upload Artifact to Release | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: blade_macos.zip | |
asset_name: blade-macos-${{ github.event.release.tag_name }}.zip | |
asset_content_type: application/zip | |
build-windows: | |
runs-on: windows-latest | |
steps: | |
- name: Setup cmake | |
uses: jwlawson/[email protected] | |
with: | |
cmake-version: '3.28.x' | |
- name: Setup WinLibs | |
uses: bwoodsend/[email protected] | |
with: | |
add_to_path: true | |
tag: 14.2.0posix-18.1.8-12.0.0-msvcrt-r1 | |
- uses: actions/checkout@v4 | |
- uses: friendlyanon/setup-vcpkg@v1 | |
with: { committish: 3508985146f1b1d248c67ead13f8f54be5b4f5da, cache-version: "1", cache-key: "vcpkg-windows", cache-restore-keys: "vcpkg-windows" } | |
- name: Install Dependencies | |
run: | | |
${{ env.VCPKG_ROOT }}/vcpkg update | |
${{ env.VCPKG_ROOT }}/vcpkg version | |
${{ env.VCPKG_ROOT }}/vcpkg install pkgconf curl:x64-windows libffi:x64-windows openssl:x64-windows libgd:x64-windows | |
${{ env.VCPKG_ROOT }}/vcpkg list | |
- name: Compile | |
run: | | |
cmake -B . -G "Unix Makefiles" -DCMAKE_MAKE_PROGRAM=mingw32-make -DCMAKE_TOOLCHAIN_FILE="${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake" -DOPENSSL_ROOT_DIR=${{ env.VCPKG_ROOT }}/installed/x64-windows-static | |
cmake --build . | |
- name: Create ZIP Archive | |
shell: cmd | |
run: | | |
powershell Compress-Archive blade blade_windows.zip | |
- name: Generate Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: windows | |
path: blade_windows.zip | |
- name: Upload Artifact to Release | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: blade_windows.zip | |
asset_name: blade-windows-${{ github.event.release.tag_name }}.zip | |
asset_content_type: application/zip |