Build #83
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: Build | |
on: | |
workflow_run: | |
workflows: ["Run Tests"] | |
branches: [master] | |
types: | |
- completed | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build_linux: | |
strategy: | |
matrix: | |
app: [icy_term, icy_draw, icy_view] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install required libraries | |
run: | | |
sudo apt-get install build-essential libasound2-dev libxcb-shape0-dev libxcb-xfixes0-dev | |
- name: Build deb | |
id: build-deb | |
run: | | |
cargo install cargo-deb | |
export version=$(python3 tools/prep_diz.py "${{ matrix.app }}" "file_id.diz") | |
echo "VERSION=$version" >> $GITHUB_ENV | |
echo "Version: $version" | |
cd crates/${{ matrix.app }} | |
export DEB=$(cargo deb) | |
echo "Copy $DEB to ${{ matrix.app }}.deb" | |
mv $DEB "../../${{ matrix.app }}.deb" | |
cd ../.. | |
- name: 'Upload deb' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.app }}_linux_${{ env.VERSION }} | |
path: | | |
${{ matrix.app }}.deb | |
file_id.diz | |
build_windows: | |
strategy: | |
matrix: | |
app: [icy_term, icy_draw, icy_view, icy_play] | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Prepare FILE_ID.DIZ | |
run: | | |
$VERSION=$(python tools\prep_diz.py "${{ matrix.app }}" "file_id.diz") | |
echo "Version: $VERSION" | |
Add-Content -Path $env:GITHUB_ENV -Value "VERSION=$VERSION" | |
get-content .\crates\${{ matrix.app }}\build\file_id.diz | %{$_ -replace "#VERSION","$VERSION"} >file_id.diz | |
- name: Build exe | |
run: | | |
cd .\crates\${{ matrix.app }} | |
cargo build --release | |
cd ..\.. | |
move .\target\release\${{ matrix.app }}.exe . | |
- name: 'Upload executable' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.app }}_windows_${{ env.VERSION }} | |
path: | | |
${{ matrix.app }}.exe | |
file_id.diz | |
build_mac: | |
strategy: | |
matrix: | |
app: [icy_term, icy_draw, icy_view] | |
runs-on: macos-13 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install cargo bundle & get | |
run: | | |
rustup target add aarch64-apple-darwin | |
rustup target add x86_64-apple-darwin | |
cargo install cargo-bundle | |
brew install create-dmg | |
- name: Build app | |
run: | | |
cd crates/${{ matrix.app }} | |
cargo build --release --target aarch64-apple-darwin | |
cargo build --release --target x86_64-apple-darwin | |
cd ../.. | |
export app=$(python3 tools/get_name.py "${{ matrix.app }}") | |
echo "Build bundle for: $app" | |
echo "APP=$app" >> $GITHUB_ENV | |
mkdir -p "${{ matrix.app }}.app/Contents/MacOS" | |
mkdir -p "${{ matrix.app }}.app/Contents/Resources" | |
cp crates/${{ matrix.app }}/build/mac/Info.plist "${{ matrix.app }}.app/Contents/Info.plist" | |
mkdir -p AppIcon.iconset | |
sips -z 16 16 crates/${{ matrix.app }}/build/mac/128x128@2x.png --out AppIcon.iconset/icon_16x16.png | |
sips -z 32 32 crates/${{ matrix.app }}/build/mac/128x128@2x.png --out AppIcon.iconset/icon_16x16@2x.png | |
sips -z 32 32 crates/${{ matrix.app }}/build/mac/128x128@2x.png --out AppIcon.iconset/icon_32x32.png | |
sips -z 64 64 crates/${{ matrix.app }}/build/mac/128x128@2x.png --out AppIcon.iconset/icon_32x32@2.png | |
sips -z 128 128 crates/${{ matrix.app }}/build/mac/128x128@2x.png --out AppIcon.iconset/icon_128x128.png | |
cp crates/${{ matrix.app }}/build/mac/128x128@2x.png AppIcon.iconset/icon_128x128@2x.png | |
iconutil -c icns AppIcon.iconset | |
cp AppIcon.icns "${{ matrix.app }}.app/Contents/Resources" | |
export version=$(python3 tools/prep_diz.py "${{ matrix.app }}" "file_id.diz") | |
echo "VERSION=$version" >> $GITHUB_ENV | |
echo "Version: $version" | |
lipo "target/x86_64-apple-darwin/release/${{ matrix.app }}" \ | |
"target/aarch64-apple-darwin/release/${{ matrix.app }}" \ | |
-create -output "${{ matrix.app }}.app/Contents/MacOS/${{ matrix.app }}" | |
- name: Sign dmg | |
id: sign-bundle | |
run: | | |
create-dmg \ | |
--volname "${{ env.APP }} Installer" \ | |
--volicon "AppIcon.icns" \ | |
--window-pos 200 120 \ | |
--window-size 800 400 \ | |
--icon-size 128 \ | |
--hide-extension "${{ matrix.app }}.app" \ | |
--app-drop-link 600 185 \ | |
"${{ matrix.app }}-${{ env.VERSION }}-universal.dmg" \ | |
"${{ matrix.app }}.app" | |
- name: 'Upload dmg' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.app }}_osx_${{ env.VERSION }}${{ matrix.target }} | |
path: | | |
${{ matrix.app }}-${{ env.VERSION }}-universal.dmg | |
file_id.diz |