summaryrefslogtreecommitdiffstats
path: root/.github/workflows/build.yml
blob: b30b7a6179a1a7c2cbc9c08543bf64a4cfba0e43 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Build
on:
  push:
    branches:
      - master
jobs:
  todos_linux:
    runs-on: ubuntu-latest
    steps:
    - uses: hecrj/setup-rust-action@v1
    - name: Install cargo-deb
      run: cargo install cargo-deb
    - uses: actions/checkout@master
    - name: Install dependencies
      run: |
        export DEBIAN_FRONTED=noninteractive
        sudo apt-get -qq update
        sudo apt-get install -y libxkbcommon-dev
    - name: Build todos binary
      run: cargo build --verbose --profile release-opt --package todos
    - name: Archive todos binary
      uses: actions/upload-artifact@v1
      with:
        name: todos-x86_64-unknown-linux-gnu
        path: target/release-opt/todos
    - name: Pack todos .deb package
      run: cargo deb --no-build --profile release-opt --package todos
    - name: Rename todos .deb package
      run: mv target/debian/*.deb target/debian/iced_todos-x86_64-debian-linux-gnu.deb
    - name: Archive todos .deb package
      uses: actions/upload-artifact@v1
      with:
        name: todos-x86_64-debian-linux-gnu
        path: target/debian/iced_todos-x86_64-debian-linux-gnu.deb

  todos_windows:
    runs-on: windows-latest
    steps:
    - uses: hecrj/setup-rust-action@v1
    - uses: actions/checkout@master
    - name: Enable static CRT linkage
      run: |
        mkdir .cargo
        echo '[target.x86_64-pc-windows-msvc]' >> .cargo/config
        echo 'rustflags = ["-Ctarget-feature=+crt-static"]' >> .cargo/config
    - name: Run the application without starting the shell
      run: |
        sed -i '1 i\#![windows_subsystem = \"windows\"]' examples/todos/src/main.rs
    - name: Build todos binary
      run: cargo build --verbose --profile release-opt --package todos
    - name: Archive todos binary
      uses: actions/upload-artifact@v1
      with:
        name: todos-x86_64-pc-windows-msvc
        path: target/release-opt/todos.exe

  todos_macos:
    runs-on: macOS-latest
    steps:
    - uses: hecrj/setup-rust-action@v1
    - uses: actions/checkout@master
    - name: Build todos binary
      env:
        MACOSX_DEPLOYMENT_TARGET: 10.14
      run: cargo build --verbose --profile release-opt --package todos
    - name: Open binary via double-click
      run: chmod +x target/release-opt/todos
    - name: Archive todos binary
      uses: actions/upload-artifact@v1
      with:
        name: todos-x86_64-apple-darwin
        path: target/release-opt/todos

  todos_raspberry:
    runs-on: ubuntu-latest
    steps:
    - uses: hecrj/setup-rust-action@v1
    - uses: actions/checkout@master
    - name: Install cross
      run: cargo install cross
    - name: Build todos binary for Raspberry Pi 3/4 (64 bits)
      run: cross build --verbose --profile release-opt --package todos --target aarch64-unknown-linux-gnu
    - name: Archive todos binary
      uses: actions/upload-artifact@v1
      with:
        name: todos-aarch64-unknown-linux-gnu
        path: target/aarch64-unknown-linux-gnu/release-opt/todos
    - name: Build todos binary for Raspberry Pi 2/3/4 (32 bits)
      run: cross build --verbose --profile release-opt --package todos --target armv7-unknown-linux-gnueabihf
    - name: Archive todos binary
      uses: actions/upload-artifact@v1
      with:
        name: todos-armv7-unknown-linux-gnueabihf
        path: target/armv7-unknown-linux-gnueabihf/release-opt/todos