Skip to content

add the other content-type support for routing #22

add the other content-type support for routing

add the other content-type support for routing #22

Workflow file for this run

# .github/workflows/release.yml
name: release
on:
workflow_dispatch:
push:
tags:
- "v*"
jobs:
build-release:
name: build-release
strategy:
matrix:
build: [linux-x86_64,macos-x86_64,windows-x86_64-gnu]
include:
- build: linux-x86_64
os: ubuntu-latest
rust: nightly
target: x86_64-unknown-linux-gnu
- build: macos-x86_64
os: macos-latest
rust: nightly
target: x86_64-apple-darwin
- build: windows-x86_64-gnu
os: windows-latest
rust: nightly-x86_64-gnu
target: x86_64-pc-windows-gnu
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
# Run build
- name: install rustup
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup-init.sh
sh rustup-init.sh -y --default-toolchain none
rustup target add ${{ matrix.target }}
- name: Add mingw64 to path for x86_64-gnu
run: echo "C:\msys64\mingw64\bin" >> $GITHUB_PATH
if: matrix.rust == 'nightly-x86_64-gnu'
shell: bash
- name: Build release binaries
uses: actions-rs/cargo@v1
with:
command: build
args: --release --target ${{matrix.target}} --verbose
- name: Build archive
shell: bash
run: |
staging="${{ matrix.build }}"
mkdir -p "$staging"
cp {README.md,LICENSE} "$staging/"
cp -r static "$staging/"
if [ "${{ matrix.os }}" = "windows-latest" ]; then
cp target/${{matrix.target}}/release/mock-server.exe "$staging/"
7z a "$staging.zip" "$staging"
echo "ASSET=$staging.zip" >> $GITHUB_ENV
else
cp target/${{matrix.target}}/release/mock-server "$staging/"
tar czf "$staging.tar.gz" "$staging"
echo "ASSET=$staging.tar.gz" >> $GITHUB_ENV
fi
- name: Upload Release Asset
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: ${{ env.ASSET }}