-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
github_actions: redo github actions (#17)
* github_actions: redo github actions Migrate github build and lint workflows off of deprecated actions Add rust-toolchain.toml for easier setup * github_actions: remove duplicate linting, fix warning elevation Remove duplicate linting from build action Remove default rustflags from toolchain action, preventing warning escalation * github_actions: upgrade dependencies * github_action: remove cross dependency Add .cargo/config.toml for linker specification Add gcc and g++ requirements to github runner Compile artifacts for armv7, aarch64, and x86_64
- Loading branch information
1 parent
08c51a5
commit 4f00b38
Showing
5 changed files
with
84 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[target.armv7-unknown-linux-gnueabihf] | ||
linker = "arm-linux-gnueabihf-gcc" | ||
|
||
[target.aarch64-unknown-linux-gnu] | ||
linker = "aarch64-linux-gnu-gcc" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,56 +9,80 @@ jobs: | |
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
|
||
- uses: actions-rs/[email protected] | ||
with: | ||
toolchain: stable | ||
target: armv7-unknown-linux-gnueabihf | ||
components: clippy | ||
override: true | ||
|
||
- uses: actions-rs/[email protected] | ||
with: | ||
use-cross: true | ||
command: build | ||
args: --release --target armv7-unknown-linux-gnueabihf | ||
|
||
- uses: actions/checkout@v4 | ||
|
||
- uses: SebRollen/[email protected] | ||
id: read_toml | ||
with: | ||
file: 'Cargo.toml' | ||
field: 'package.version' | ||
|
||
- name: Copy & Compress output | ||
id: compress | ||
run: | | ||
cp target/armv7-unknown-linux-gnueabihf/release/odyssey odyssey | ||
cp target/armv7-unknown-linux-gnueabihf/release/default.yaml default.yaml | ||
cp target/armv7-unknown-linux-gnueabihf/release/apiHelper.py apiHelper.py | ||
tar -czvf odyssey.tar.gz odyssey default.yaml apiHelper.py | ||
echo "archive=$ARCHIVE" >> $GITHUB_OUTPUT | ||
- name: install dependencies | ||
run: sudo apt install -y gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf g++-aarch64-linux-gnu gcc-aarch64-linux-gnu gcc g++ | ||
|
||
- name: Update Rust Toolchain | ||
uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
with: | ||
rustflags: "" | ||
|
||
- uses: actions/[email protected] | ||
- name: Compile, Copy, and Compress armv7 | ||
run: | | ||
cargo build --release --target armv7-unknown-linux-gnueabihf | ||
mkdir odyssey_armv7 | ||
mv target/armv7-unknown-linux-gnueabihf/release/odyssey odyssey_armv7 | ||
cp default.yaml odyssey_armv7 | ||
cp apiHelper.py odyssey_armv7 | ||
tar -czvf odyssey_armv7.tar.gz odyssey_armv7 | ||
- name: upload armv7 artifact | ||
uses: actions/[email protected] | ||
with: | ||
name: odyssey_armv7 | ||
path: odyssey_armv7/* | ||
|
||
- name: Compile, Copy, and Compress aarch64 | ||
run: | | ||
cargo build --release --target aarch64-unknown-linux-gnu | ||
mkdir odyssey_aarch64 | ||
mv target/aarch64-unknown-linux-gnu/release/odyssey odyssey_aarch64 | ||
cp default.yaml odyssey_aarch64 | ||
cp apiHelper.py odyssey_aarch64 | ||
tar -czvf odyssey_aarch64.tar.gz odyssey_aarch64 | ||
- name: upload aarch64 artifact | ||
uses: actions/[email protected] | ||
with: | ||
name: odyssey | ||
path: | | ||
odyssey | ||
default.yaml | ||
apiHelper.py | ||
name: odyssey_aarch64 | ||
path: odyssey_aarch64/* | ||
|
||
- name: Compile, Copy, and Compress x86_64 | ||
run: | | ||
cargo build --release --target x86_64-unknown-linux-gnu | ||
mkdir odyssey_x86_64 | ||
mv target/x86_64-unknown-linux-gnu/release/odyssey odyssey_x86_64 | ||
cp default.yaml odyssey_x86_64 | ||
cp apiHelper.py odyssey_x86_64 | ||
tar -czvf odyssey_x86_64.tar.gz odyssey_x86_64 | ||
- name: upload x86_64 artifact | ||
uses: actions/[email protected] | ||
with: | ||
name: odyssey_x86_64 | ||
path: odyssey_x86_64/* | ||
|
||
- uses: ncipollo/[email protected] | ||
if: github.ref == 'refs/heads/main' | ||
with: | ||
artifacts: odyssey.tar.gz | ||
artifacts: "odyssey*.tar.gz" | ||
tag: v${{ steps.read_toml.outputs.value }} | ||
skipIfReleaseExists: true | ||
generateReleaseNotes: true | ||
commit: ${{github.sha}} | ||
|
||
- uses: ncipollo/[email protected] | ||
if: github.ref != 'refs/heads/main' | ||
with: | ||
artifacts: odyssey.tar.gz | ||
artifacts: "*odyssey*.tar.gz" | ||
tag: BRANCH_${{github.ref_name}} | ||
skipIfReleaseExists: false | ||
allowUpdates: true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[toolchain] | ||
channel = "stable" | ||
components = [ "rustfmt", "rustc-dev" ] | ||
targets = [ "x86_64-unknown-linux-gnu", "armv7-unknown-linux-gnueabihf", "aarch64-unknown-linux-gnu" ] | ||
profile = "default" |