diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index fefd20c..58c2100 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -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