diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 0000000..1058bf4 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,2 @@ +[profile.armv7] +rustflags = ["-C", "arm-linux-gnueabihf-gcc"] diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9105e42..5596819 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,11 +28,27 @@ jobs: profile: minimal override: true - - name: Build + - name: Setup Rust (armv7) + run: | + rustup target add armv7-unknown-linux-gnueabihf + sudo apt-get update + sudo apt-get install -y gcc-arm-linux-gnueabihf + + #- name: Build x64 + # uses: actions-rs/cargo@v1 + # with: + # command: build + # args: --release --features backend-sql + + - name: Build armv7 uses: actions-rs/cargo@v1 with: command: build - args: --release --features backend-sql + args: > + --release + --features backend-sql + --target armv7-unknown-linux-gnueabihf + --profile armv7 - name: Create Release id: create_release @@ -45,13 +61,24 @@ jobs: draft: true prerelease: false - - name: Upload Release Asset - id: upload-release-asset + - name: Upload x64 binary + id: upload-release-asset-x64 uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: target/release/podsync - asset_name: podsync + asset_name: podsync-x64 + asset_content_type: application/octet-stream + + - name: Upload armv7 binary + id: upload-release-asset-armv7 + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: target/armv7-unknown-linux-gnueabihf/release/podsync + asset_name: podsync-armv7 asset_content_type: application/octet-stream