|
|
@ -48,30 +48,40 @@ jobs:
|
|
|
|
cargo-flags: ""
|
|
|
|
cargo-flags: ""
|
|
|
|
|
|
|
|
|
|
|
|
runs-on: ${{matrix.os}}
|
|
|
|
runs-on: ${{matrix.os}}
|
|
|
|
|
|
|
|
env:
|
|
|
|
|
|
|
|
BUILD_CMD: cargo
|
|
|
|
|
|
|
|
|
|
|
|
steps:
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
|
|
|
|
|
|
|
- name: Check Tag
|
|
|
|
- name: Check Tag
|
|
|
|
id: check-tag
|
|
|
|
id: check-tag
|
|
|
|
shell: bash
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
run: |
|
|
|
|
tag=${GITHUB_REF##*/}
|
|
|
|
ver=${GITHUB_REF##*/}
|
|
|
|
echo "::set-output name=version::$tag"
|
|
|
|
echo "version=$ver" >> $GITHUB_OUTPUT
|
|
|
|
if [[ "$tag" =~ [0-9]+.[0-9]+.[0-9]+$ ]]; then
|
|
|
|
if [[ "$ver" =~ [0-9]+.[0-9]+.[0-9]+$ ]]; then
|
|
|
|
echo "::set-output name=rc::false"
|
|
|
|
echo "rc=false" >> $GITHUB_OUTPUT
|
|
|
|
else
|
|
|
|
else
|
|
|
|
echo "::set-output name=rc::true"
|
|
|
|
echo "rc=true" >> $GITHUB_OUTPUT
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Install Rust Toolchain Components
|
|
|
|
- name: Install Rust Toolchain Components
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
with:
|
|
|
|
with:
|
|
|
|
override: true
|
|
|
|
targets: ${{ matrix.target }}
|
|
|
|
target: ${{ matrix.target }}
|
|
|
|
|
|
|
|
toolchain: stable
|
|
|
|
- name: Install cross
|
|
|
|
profile: minimal # minimal component installation (ie, no documentation)
|
|
|
|
if: matrix.use-cross
|
|
|
|
|
|
|
|
uses: taiki-e/install-action@v2
|
|
|
|
|
|
|
|
with:
|
|
|
|
|
|
|
|
tool: cross
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Overwrite build command env variable
|
|
|
|
|
|
|
|
if: matrix.use-cross
|
|
|
|
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
run: echo "BUILD_CMD=cross" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
|
|
|
|
- name: Show Version Information (Rust, cargo, GCC)
|
|
|
|
- name: Show Version Information (Rust, cargo, GCC)
|
|
|
|
shell: bash
|
|
|
|
shell: bash
|
|
|
@ -84,11 +94,8 @@ jobs:
|
|
|
|
rustc -V
|
|
|
|
rustc -V
|
|
|
|
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
- name: Build
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
shell: bash
|
|
|
|
with:
|
|
|
|
run: $BUILD_CMD build --locked --release --target=${{ matrix.target }} ${{ matrix.cargo-flags }}
|
|
|
|
use-cross: ${{ matrix.use-cross }}
|
|
|
|
|
|
|
|
command: build
|
|
|
|
|
|
|
|
args: --locked --release --target=${{ matrix.target }} ${{ matrix.cargo-flags }}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Build Archive
|
|
|
|
- name: Build Archive
|
|
|
|
shell: bash
|
|
|
|
shell: bash
|
|
|
@ -116,15 +123,15 @@ jobs:
|
|
|
|
if [[ "$RUNNER_OS" == "Windows" ]]; then
|
|
|
|
if [[ "$RUNNER_OS" == "Windows" ]]; then
|
|
|
|
archive=$dist/$name.zip
|
|
|
|
archive=$dist/$name.zip
|
|
|
|
7z a $archive *
|
|
|
|
7z a $archive *
|
|
|
|
echo "::set-output name=archive::`pwd -W`/$name.zip"
|
|
|
|
echo "archive=$archive" >> $GITHUB_OUTPUT
|
|
|
|
else
|
|
|
|
else
|
|
|
|
archive=$dist/$name.tar.gz
|
|
|
|
archive=$dist/$name.tar.gz
|
|
|
|
tar czf $archive *
|
|
|
|
tar czf $archive *
|
|
|
|
echo "::set-output name=archive::$archive"
|
|
|
|
echo "archive=$archive" >> $GITHUB_OUTPUT
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
- name: Publish Archive
|
|
|
|
- name: Publish Archive
|
|
|
|
uses: softprops/action-gh-release@v0.1.5
|
|
|
|
uses: softprops/action-gh-release@v1
|
|
|
|
if: ${{ startsWith(github.ref, 'refs/tags/') }}
|
|
|
|
if: ${{ startsWith(github.ref, 'refs/tags/') }}
|
|
|
|
with:
|
|
|
|
with:
|
|
|
|
draft: false
|
|
|
|
draft: false
|
|
|
@ -139,13 +146,11 @@ jobs:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: release
|
|
|
|
needs: release
|
|
|
|
steps:
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
|
|
|
|
with:
|
|
|
|
|
|
|
|
profile: minimal
|
|
|
|
|
|
|
|
toolchain: stable
|
|
|
|
|
|
|
|
- name: Publish
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Publish
|
|
|
|
env:
|
|
|
|
env:
|
|
|
|
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_API_TOKEN }}
|
|
|
|
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_API_TOKEN }}
|
|
|
|
run: cargo publish
|
|
|
|
run: cargo publish
|