|
3 | 3 | push:
|
4 | 4 | tags:
|
5 | 5 | - "v*"
|
| 6 | +env: |
| 7 | + SHORT_NAME: walle-q |
| 8 | + CRATE_NAME: walle-q |
6 | 9 |
|
7 | 10 | jobs:
|
8 |
| - release-win: |
9 |
| - runs-on: windows-latest |
| 11 | + compile: |
| 12 | + name: Compile |
| 13 | + runs-on: ${{ matrix.os }} |
10 | 14 | strategy:
|
11 | 15 | matrix:
|
12 | 16 | include:
|
13 |
| - - target: i686-pc-windows-msvc |
14 |
| - name: walle-q-win-i686.exe |
15 |
| - - target: x86_64-pc-windows-msvc |
16 |
| - name: walle-q-win-x86_64.exe |
| 17 | + # Linux |
| 18 | + - os: ubuntu-latest |
| 19 | + target: x86_64-unknown-linux-musl |
| 20 | + release_name: x86_64-linux-musl |
| 21 | + postfix: "" |
| 22 | + extra_args: "" |
| 23 | + cross: true |
| 24 | + |
| 25 | + - os: ubuntu-latest |
| 26 | + target: i686-unknown-linux-musl |
| 27 | + release_name: i686-linux-musl |
| 28 | + postfix: "" |
| 29 | + extra_args: "" |
| 30 | + cross: true |
| 31 | + |
| 32 | + - os: ubuntu-latest |
| 33 | + target: aarch64-unknown-linux-gnu |
| 34 | + release_name: aarch64-linux-gnu |
| 35 | + postfix: "" |
| 36 | + extra_args: "" |
| 37 | + cross: true |
| 38 | + # Windows GNU |
| 39 | + - os: ubuntu-latest |
| 40 | + target: x86_64-pc-windows-gnu |
| 41 | + release_name: x86_64-windows-gnu.exe |
| 42 | + postfix: ".exe" |
| 43 | + extra_args: "" |
| 44 | + cross: true |
| 45 | + |
| 46 | + - os: ubuntu-latest |
| 47 | + target: i686-pc-windows-gnu |
| 48 | + release_name: i686-windows-gnu.exe |
| 49 | + postfix: ".exe" |
| 50 | + extra_args: "" |
| 51 | + cross: true |
| 52 | + |
| 53 | + # Mac OSX |
| 54 | + - os: macos-latest |
| 55 | + target: x86_64-apple-darwin |
| 56 | + release_name: x86_64-mac |
| 57 | + postfix: "" |
| 58 | + extra_args: "" |
| 59 | + cross: false |
17 | 60 |
|
18 | 61 | steps:
|
19 |
| - - name: checkout |
20 |
| - uses: actions/checkout@v2 |
| 62 | + - uses: actions/checkout@v2 |
| 63 | + with: |
| 64 | + submodules: recursive |
| 65 | + |
| 66 | + - name: Resume cache |
| 67 | + uses: actions/cache@v2 |
21 | 68 | with:
|
22 |
| - fetch-depth: 0 |
23 |
| - - name: rust-toolchain |
24 |
| - uses: actions-rs/toolchain@v1 |
| 69 | + path: | |
| 70 | + ~/.cargo/registry |
| 71 | + ~/.cargo/git |
| 72 | + key: ${{ matrix.target }}-release-${{ hashFiles('**/Cargo.toml') }} |
| 73 | + restore-keys: | |
| 74 | + ${{ matrix.target }}-release |
| 75 | +
|
| 76 | + - uses: actions-rs/toolchain@v1 |
25 | 77 | with:
|
26 | 78 | toolchain: nightly
|
27 |
| - override: true |
28 | 79 | target: ${{ matrix.target }}
|
29 |
| - - name: set-up-clang |
30 |
| - uses: egor-tensin/setup-clang@v1 |
31 |
| - - name: cargo-build |
32 |
| - uses: actions-rs/cargo@v1 |
| 80 | + override: true |
| 81 | + |
| 82 | + - uses: actions-rs/cargo@v1 |
33 | 83 | with:
|
| 84 | + use-cross: ${{ matrix.cross }} |
34 | 85 | command: build
|
35 |
| - args: --release --target ${{ matrix.target }} |
36 |
| - - name: upload-release |
37 |
| - uses: svenstaro/upload-release-action@v2 |
| 86 | + args: --release --target ${{ matrix.target }} ${{ matrix.extra_args }} |
| 87 | + |
| 88 | + - name: Rename binary |
| 89 | + run: mv target/${{ matrix.target }}/release/${{ env.CRATE_NAME }}${{ matrix.postfix }} ${{ env.SHORT_NAME }}-${{ matrix.release_name }} |
| 90 | + |
| 91 | + - name: Upload binaries |
| 92 | + uses: actions/upload-artifact@v2 |
38 | 93 | with:
|
39 |
| - repo_token: ${{ secrets.GITHUB_TOKEN }} |
40 |
| - file: target/${{ matrix.target }}/release/walle-q.exe |
41 |
| - asset_name: ${{ matrix.name }} |
42 |
| - tag: ${{ github.ref }} |
| 94 | + name: compile |
| 95 | + path: ${{ env.SHORT_NAME }}-${{ matrix.release_name }} |
43 | 96 |
|
44 |
| - release-linux: |
| 97 | + release: |
| 98 | + name: Release |
| 99 | + needs: [compile] |
45 | 100 | runs-on: ubuntu-latest
|
46 |
| - strategy: |
47 |
| - matrix: |
48 |
| - include: |
49 |
| - - target: i686-unknown-linux-gnu |
50 |
| - name: walle-q-linux-i686 |
51 |
| - - target: x86_64-unknown-linux-gnu |
52 |
| - name: walle-q-linux-x86_64 |
53 |
| - |
54 | 101 | steps:
|
55 |
| - - name: checkout |
56 |
| - uses: actions/checkout@v2 |
57 |
| - with: |
58 |
| - fetch-depth: 0 |
59 |
| - - name: multilib |
60 |
| - if: ${{ matrix.target == 'i686-unknown-linux-gnu' }} |
61 |
| - run: sudo apt-get install -y gcc-multilib |
62 |
| - - name: rust-toolchain |
63 |
| - uses: actions-rs/toolchain@v1 |
| 102 | + - uses: actions/checkout@v2 |
64 | 103 | with:
|
65 |
| - toolchain: nightly |
66 |
| - override: true |
67 |
| - target: ${{ matrix.target }} |
68 |
| - - name: set-up-clang |
69 |
| - uses: egor-tensin/setup-clang@v1 |
70 |
| - - name: cargo-build |
71 |
| - uses: actions-rs/cargo@v1 |
| 104 | + submodules: recursive |
| 105 | + |
| 106 | + - name: Download binaries |
| 107 | + uses: actions/download-artifact@v2 |
72 | 108 | with:
|
73 |
| - command: build |
74 |
| - args: --release --target ${{ matrix.target }} |
75 |
| - - name: upload-release |
76 |
| - uses: svenstaro/upload-release-action@v2 |
| 109 | + name: compile |
| 110 | + path: ./packages |
| 111 | + |
| 112 | + - name: Compress |
| 113 | + run: bash ./.github/compress.sh |
| 114 | + |
| 115 | + - name: Github release |
| 116 | + uses: "marvinpinto/action-automatic-releases@latest" |
77 | 117 | with:
|
78 |
| - repo_token: ${{ secrets.GITHUB_TOKEN }} |
79 |
| - file: target/${{ matrix.target }}/release/walle-q |
80 |
| - asset_name: ${{ matrix.name }} |
81 |
| - tag: ${{ github.ref }} |
| 118 | + repo_token: "${{ secrets.GITHUB_TOKEN }}" |
| 119 | + prerelease: false |
| 120 | + files: | |
| 121 | + packages/* |
| 122 | + LICENSE |
0 commit comments