Skip to content

Commit

Permalink
Version 0.4.1
Browse files Browse the repository at this point in the history
Build on aarch64-unknown-linux-gnu and aarch64-apple-darwin
  • Loading branch information
PeterDing committed Apr 20, 2022
1 parent d990376 commit 0322c4b
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 4 deletions.
16 changes: 15 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
- linux
- windows
- mac
- mac-aarch64
include:
- build: linux
os: ubuntu-latest
Expand All @@ -29,6 +30,10 @@ jobs:
- build: mac
os: macos-latest
rust: "stable"
- build: mac-aarch64
os: macos-latest
rust: "stable"
target: aarch64-apple-darwin

runs-on: ${{ matrix.os }}

Expand All @@ -42,13 +47,22 @@ jobs:
profile: minimal
override: true

- name: Install aarch64 toolchain
if: matrix.target == 'aarch64-apple-darwin'
run: rustup target add aarch64-apple-darwin

- uses: Swatinem/rust-cache@v1

- name: Build
if: matrix.target != 'aarch64-apple-darwin'
run: cargo build --verbose

- name: Build aarch64
if: matrix.target == 'aarch64-apple-darwin'
run: cargo build --target=aarch64-apple-darwin --verbose

- name: Tests
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
if: matrix.os == 'ubuntu-latest'
run: |
cargo test --verbose
bash ci/script.bash
Expand Down
31 changes: 29 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ on:
tags:
- "[0-9]+.[0-9]+.[0-9]+"

env:
CARGO_TERM_COLOR: always

jobs:
create-release:
name: create-release
Expand All @@ -42,6 +45,7 @@ jobs:
# See: https://github.community/t5/GitHub-Actions/How-to-get-just-the-tag-name/m-p/32167/highlight/true#M1027
echo "AG_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
echo "version is: ${{ env.AG_VERSION }}"
- name: Create GitHub release
id: release
uses: actions/create-release@v1
Expand All @@ -67,7 +71,7 @@ jobs:
RUST_BACKTRACE: 1
strategy:
matrix:
build: [linux, linux-arm, macos, win-msvc, win-gnu, win32-msvc]
build: [linux, linux-arm, linux-aarch64, macos, macos-aarch64, win-msvc, win-gnu, win32-msvc]
include:
- build: linux
os: ubuntu-18.04
Expand All @@ -77,10 +81,18 @@ jobs:
os: ubuntu-18.04
rust: nightly
target: arm-unknown-linux-gnueabihf
- build: linux-aarch64
os: ubuntu-18.04
rust: nightly
target: aarch64-unknown-linux-gnu
- build: macos
os: macos-latest
rust: nightly
target: x86_64-apple-darwin
- build: macos-aarch64
os: macos-latest
rust: nightly
target: aarch64-apple-darwin
- build: win-msvc
os: windows-2019
rust: nightly
Expand Down Expand Up @@ -117,16 +129,30 @@ jobs:
echo "CARGO=cross" >> $GITHUB_ENV
echo "TARGET_FLAGS=--target ${{ matrix.target }}" >> $GITHUB_ENV
echo "TARGET_DIR=./target/${{ matrix.target }}" >> $GITHUB_ENV
- name: Show command used for Cargo
run: |
echo "cargo command is: ${{ env.CARGO }}"
echo "target flag is: ${{ env.TARGET_FLAGS }}"
echo "target dir is: ${{ env.TARGET_DIR }}"
- name: Build aarch64-unknown-linux-gnu
if: matrix.build == 'linux-aarch64'
run: |
rustup target add aarch64-unknown-linux-gnu
sudo apt-get update
sudo apt-get install -yq gcc-aarch64-linux-gnu
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=/usr/bin/aarch64-linux-gnu-gcc
cargo build --verbose --release ${{ env.TARGET_FLAGS }}
echo "- Strip release binary (linux-aarch64)"
aarch64-linux-gnu-strip "target/${{ matrix.target }}/release/ag"
- name: Build release binary
if: matrix.build != 'linux-aarch64'
run: ${{ env.CARGO }} build --verbose --release ${{ env.TARGET_FLAGS }}

- name: Strip release binary (linux and macos)
if: matrix.build == 'linux' || matrix.build == 'macos'
if: matrix.build == 'linux' || matrix.build == 'macos' || matrix.build == 'macos-aarch64'
run: strip "target/${{ matrix.target }}/release/ag"

- name: Strip release binary (arm)
Expand All @@ -153,6 +179,7 @@ jobs:
tar czf "$staging.tar.gz" "$staging"
echo "ASSET=$staging.tar.gz" >> $GITHUB_ENV
fi
- name: Upload release archive
uses: actions/[email protected]
env:
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 0.4.1 - 2022-04-20

### Added

- Use `tracing` to log.

## 0.4.0 - 2022-04-19

### Updated
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "aget-rs"
version = "0.4.0"
version = "0.4.1"
authors = ["PeterDing <[email protected]>"]
homepage = "https://github.com/PeterDing/aget-rs"
description="Aget-rs - Fast Asynchronous Downloader with Rust 🦀"
Expand Down

0 comments on commit 0322c4b

Please sign in to comment.