build.yml - icy_draw - [fork] icy_draw is the successor to mystic draw.
 (HTM) git clone https://git.drkhsh.at/icy_draw.git
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
       ---
       build.yml (4910B)
       ---
            1 name: Build
            2 on:
            3   workflow_run:
            4     workflows: ["Run Tests"]
            5     branches: [master]
            6     types: 
            7       - completed
            8 env:
            9   CARGO_TERM_COLOR: always
           10 jobs:
           11   build_linux:
           12    strategy:
           13      matrix:
           14        app: [icy_term, icy_draw, icy_view]
           15    runs-on: ubuntu-latest
           16    steps:
           17    - uses: actions/checkout@v4
           18    - name: Install required libraries
           19      run: |
           20        sudo apt-get install build-essential libasound2-dev libxcb-shape0-dev libxcb-xfixes0-dev
           21    - name: Build deb
           22      id: build-deb
           23      run: |
           24        cargo install cargo-deb
           25        export version=$(python3 tools/prep_diz.py "${{ matrix.app }}" "file_id.diz")
           26        echo "VERSION=$version" >> $GITHUB_ENV
           27        echo "Version: $version"
           28        cd crates/${{ matrix.app }}
           29        export DEB=$(cargo deb)
           30        echo "Copy $DEB to ${{ matrix.app }}.deb"
           31        mv $DEB "../../${{ matrix.app }}.deb"
           32        cd ../..
           33    - name: 'Upload deb'
           34      uses: actions/upload-artifact@v4
           35      with:
           36        name: ${{ matrix.app }}_linux_${{ env.VERSION }}
           37        path: |
           38          ${{ matrix.app }}.deb
           39          file_id.diz
           40   build_windows:
           41     strategy:
           42       matrix:
           43         app: [icy_term, icy_draw, icy_view, icy_play]
           44     runs-on: windows-latest
           45     steps:
           46     - uses: actions/checkout@v4
           47     - name: Prepare FILE_ID.DIZ
           48       run: |
           49         $VERSION=$(python tools\prep_diz.py "${{ matrix.app }}" "file_id.diz")
           50         echo "Version: $VERSION"
           51         
           52         Add-Content -Path $env:GITHUB_ENV -Value "VERSION=$VERSION"
           53         get-content .\crates\${{ matrix.app }}\build\file_id.diz | %{$_ -replace "#VERSION","$VERSION"} >file_id.diz
           54     - name: Build exe
           55       run: |
           56         cd .\crates\${{ matrix.app }}
           57         cargo build --release
           58         cd ..\..
           59         move .\target\release\${{ matrix.app }}.exe .
           60     - name: 'Upload executable'
           61       uses: actions/upload-artifact@v4
           62       with:
           63         name: ${{ matrix.app }}_windows_${{ env.VERSION }}
           64         path: |
           65           ${{ matrix.app }}.exe
           66           file_id.diz
           67   build_mac:
           68     strategy:
           69       matrix:
           70         app: [icy_term, icy_draw, icy_view]
           71     runs-on: macos-13
           72     steps:
           73       - uses: actions/checkout@v4
           74       - name: Install cargo bundle & get
           75         run: |
           76           rustup target add aarch64-apple-darwin
           77           rustup target add x86_64-apple-darwin
           78           cargo install cargo-bundle
           79           brew install create-dmg
           80       - name: Build app
           81         run: |
           82           cd crates/${{ matrix.app }}
           83           cargo build --release --target aarch64-apple-darwin
           84           cargo build --release --target x86_64-apple-darwin
           85           cd ../..
           86 
           87           export app=$(python3 tools/get_name.py "${{ matrix.app }}")
           88           echo "Build bundle for: $app"
           89           echo "APP=$app" >> $GITHUB_ENV
           90 
           91           mkdir -p "${{ matrix.app }}.app/Contents/MacOS"
           92           mkdir -p "${{ matrix.app }}.app/Contents/Resources"
           93 
           94           cp crates/${{ matrix.app }}/build/mac/Info.plist "${{ matrix.app }}.app/Contents/Info.plist"
           95 
           96           mkdir -p AppIcon.iconset
           97           sips -z 16 16 crates/${{ matrix.app }}/build/mac/128x128@2x.png --out AppIcon.iconset/icon_16x16.png
           98           sips -z 32 32 crates/${{ matrix.app }}/build/mac/128x128@2x.png --out AppIcon.iconset/icon_16x16@2x.png
           99           sips -z 32 32 crates/${{ matrix.app }}/build/mac/128x128@2x.png --out AppIcon.iconset/icon_32x32.png
          100           sips -z 64 64 crates/${{ matrix.app }}/build/mac/128x128@2x.png --out AppIcon.iconset/icon_32x32@2.png
          101           sips -z 128 128 crates/${{ matrix.app }}/build/mac/128x128@2x.png --out AppIcon.iconset/icon_128x128.png
          102           cp crates/${{ matrix.app }}/build/mac/128x128@2x.png AppIcon.iconset/icon_128x128@2x.png
          103           iconutil -c icns AppIcon.iconset
          104           cp AppIcon.icns "${{ matrix.app }}.app/Contents/Resources"
          105           
          106           export version=$(python3 tools/prep_diz.py "${{ matrix.app }}" "file_id.diz")
          107           echo "VERSION=$version" >> $GITHUB_ENV
          108           echo "Version: $version"
          109 
          110           lipo "target/x86_64-apple-darwin/release/${{ matrix.app }}" \
          111                "target/aarch64-apple-darwin/release/${{ matrix.app }}" \
          112                -create -output "${{ matrix.app }}.app/Contents/MacOS/${{ matrix.app }}"
          113 
          114       - name: Sign dmg
          115         id: sign-bundle
          116         run: |
          117           create-dmg \
          118             --volname "${{ env.APP }} Installer" \
          119             --volicon "AppIcon.icns" \
          120             --window-pos 200 120 \
          121             --window-size 800 400 \
          122             --icon-size 128 \
          123             --hide-extension "${{ matrix.app }}.app" \
          124             --app-drop-link 600 185 \
          125             "${{ matrix.app }}-${{ env.VERSION }}-universal.dmg" \
          126             "${{ matrix.app }}.app"
          127       - name: 'Upload dmg'
          128         uses: actions/upload-artifact@v4
          129         with:
          130           name: ${{ matrix.app }}_osx_${{ env.VERSION }}${{ matrix.target }}
          131           path: |
          132             ${{ matrix.app }}-${{ env.VERSION }}-universal.dmg
          133