Skip to content

Commit

Permalink
fix: move builds to use actions-rs/cargo with optional cross (#34)
Browse files Browse the repository at this point in the history
* testing alternative arm deployment

* specify version

* testing a different distro

* move to floating version

* move rust installation to `run` section

* install curl

* retry with `aarch64-unknown-linux-gnu` target

* bump for action

* another musl attempt

* attempt with `armv7-unknown-linux-gnueabihf`

* another attempt with `aarch64-unknown-linux-gnu`

* attempt 1001

* attempt 1002

* testing with `actions-rs/cargo`

* trying without `rustup target add`

* use cross across all archs

* remove if from macOS

* uncomment release code
  • Loading branch information
afonsojramos authored Mar 25, 2022
1 parent 723e618 commit f6d3c2a
Showing 1 changed file with 57 additions and 29 deletions.
86 changes: 57 additions & 29 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,28 @@ jobs:
default: true
override: true

- name: Build
run: cargo build --all --release && mv target/release/discrakt target/release/discrakt_amd64

- name: Chmod
run: chmod +x target/release/discrakt_amd64
- name: Build amd64
uses: actions-rs/cargo@v1
with:
command: build
args: --all --release

- name: Add ARM Target
run: rustup target add aarch64-unknown-linux-gnu
- name: Prepare amd64 binary
run: |
mv target/release/discrakt target/release/discrakt_amd64
chmod +x target/release/discrakt_amd64
- name: Build
run: cargo build --all --release --target=aarch64-unknown-linux-gnu && mv target/aarch64-unknown-linux-gnu/release/discrakt target/release/discrakt_arm64
- name: Build arm64
uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --all --release --target=aarch64-unknown-linux-musl

- name: Chmod
run: chmod +x target/release/discrakt_arm64
- name: Prepare arm64 Binary
run: |
mv target/aarch64-unknown-linux-musl/release/discrakt target/release/discrakt_arm64
chmod +x target/release/discrakt_arm64
- name: Release
uses: softprops/action-gh-release@v1
Expand Down Expand Up @@ -86,20 +94,32 @@ jobs:
default: true
override: true

- name: Build
run: cargo build --all --release && mv target/release/discrakt.exe target/release/discrakt_win64.exe
- name: Build win64
uses: actions-rs/cargo@v1
with:
command: build
args: --all --release

- name: Prepare win64 Binary
run: mv target/release/discrakt.exe target/release/discrakt_win64.exe

- name: Create silent executable
- name: Create silent win64 executable
run: sed -i '1i\#\!\[windows_subsystem\ \=\ \"windows\"\]' src/main.rs

- name: Build silent executable
run: cargo build --all --release && mv target/release/discrakt.exe target/release/discrakt_silent_win64.exe
- name: Build silent win64 executable
uses: actions-rs/cargo@v1
with:
command: build
args: --all --release

- name: Prepare silent win64 Binary
run: mv target/release/discrakt.exe target/release/discrakt_win64_silent.exe

- name: Release silent executable
uses: softprops/action-gh-release@v1
with:
files: |
target/release/discrakt_silent_win64.exe
target/release/discrakt_win64_silent.exe
target/release/discrakt_win64.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -121,20 +141,28 @@ jobs:
default: true
override: true

- name: Build for mac
run: cargo build --all --release && mv target/release/discrakt target/release/discrakt_darwin

- name: Chmod
run: chmod +x target/release/discrakt_darwin

- name: Add ARM Target
run: rustup target add aarch64-apple-darwin
- name: Build darwin
uses: actions-rs/cargo@v1
with:
command: build
args: --all --release

- name: Build
run: cargo build --all --release --target=aarch64-apple-darwin && mv target/aarch64-apple-darwin/release/discrakt target/release/discrakt_darwin_arm64
- name: Prepare darwin binary
run: |
mv target/release/discrakt target/release/discrakt_darwin
chmod +x target/release/discrakt_darwin
- name: Chmod
run: chmod +x target/release/discrakt_darwin_arm64
- name: Build darwin arm64
uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --all --release --target=aarch64-apple-darwin

- name: Prepare darwin arm64 binary
run: |
mv target/aarch64-apple-darwin/release/discrakt target/release/discrakt_darwin_arm64
chmod +x target/release/discrakt_darwin_arm64
- name: Release
uses: softprops/action-gh-release@v1
Expand Down

0 comments on commit f6d3c2a

Please sign in to comment.