Skip to content

Commit

Permalink
Update rust.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
vinhjaxt authored Apr 17, 2022
1 parent fdaf51a commit 7174469
Showing 1 changed file with 51 additions and 5 deletions.
56 changes: 51 additions & 5 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,65 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

# Build amd64 gnu
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: x86_64-unknown-linux-gnu
override: true
- name: Build x64 gnu
uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --target x86_64-unknown-linux-gnu --release
# Done amd64 gnu

# Build amd64 musl
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: x86_64-unknown-linux-musl
override: true
- name: Build x64 musl
uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --target x86_64-unknown-linux-musl --release
# Done amd64 musl

# Build arm64 musl
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: aarch64-unknown-linux-musl
override: true
- name: Build aarch 64 binary
- name: Build aarch64 musl
uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --target aarch64-unknown-linux-musl --release
- run: mv target/aarch64-unknown-linux-musl/release/static-fs target/aarch64-unknown-linux-musl/release/static-fs-linux-musl-aarch64
- uses: actions/upload-artifact@v2
# Done arm64 musl

# Create release
- name: Generate release tag
id: tag
run: |
echo "::set-output name=release_tag::ActionBuild_$(date +"%Y.%m.%d_%H-%M-%S")"
- name: Move files
run: |
mv ./target/aarch64-unknown-linux-musl/release/static-fs ./static-fs-linux-musl-aarch64
mv ./target/x86_64-unknown-linux-musl/release/static-fs ./static-fs-linux-musl-amd64
mv ./target/x86_64-unknown-linux-gnu/release/static-fs ./static-fs-linux-gnu-amd64
- name: Release
uses: softprops/action-gh-release@v1
with:
name: aarch64-artifact
path: target/aarch64-unknown-linux-musl/release/static-fs-linux-musl-aarch64
tag_name: ${{ steps.tag.outputs.release_tag }}
files: |
./static-fs-linux-musl-aarch64
./static-fs-linux-musl-amd64
./static-fs-linux-gnu-amd64
# Done release

0 comments on commit 7174469

Please sign in to comment.