Comment out embed. #142
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
tags: | |
- 'v*' # Run when tag matches v*, i.e. v1.0, v20.15.10 | |
name: Release | |
env: | |
RELEASE_BIN: ai00_server | |
RELEASE_DIR: artifacts | |
GITHUB_REF: '${{ github.ref }}' | |
WINDOWS_TARGET: x86_64-pc-windows-msvc | |
MACOS_TARGET: x86_64-apple-darwin | |
MACOS_ARM64_TARGET: aarch64-apple-darwin | |
LINUX_TARGET: x86_64-unknown-linux-gnu | |
# Space separated paths to include in the archive. | |
RELEASE_BINS: ai00-server converter | |
RELEASE_ADDS: README.md README.zh.md LICENSE assets | |
jobs: | |
build: | |
name: Build artifacts | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
build: [linux, macos, windows] | |
include: | |
- build: linux | |
os: ubuntu-latest | |
rust: stable | |
- build: macos | |
os: macos-latest | |
MACOSX_DEPLOYMENT_TARGET: 10.7 | |
rust: stable | |
- build: macos_arm64 | |
os: macos-latest | |
MACOSX_DEPLOYMENT_TARGET: 11.0 | |
rust: stable | |
- build: windows | |
os: windows-latest | |
rust: stable | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
lfs: true | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: ${{ matrix.rust }} | |
override: true | |
target: wasm32-unknown-unknown | |
- name: Checkout LFS objects | |
run: git lfs checkout | |
- name: Query version number | |
id: get_version | |
shell: bash | |
run: | | |
echo "using version tag ${GITHUB_REF:10}" | |
echo "version=${GITHUB_REF:10}" >> $GITHUB_OUTPUT | |
- name: Install tools (Linux) | |
if: matrix.build == 'linux' | |
run: | | |
sudo apt-get update -y --allow-releaseinfo-change | |
sudo apt-get install libudev-dev | |
sudo apt-get install libasound2-dev | |
- name: Install p7zip (MacOS) | |
if: matrix.build == 'macos' | |
run: brew install p7zip | |
- name: Build (Linux) | |
if: matrix.build == 'linux' | |
run: | | |
rustup target add ${{ env.LINUX_TARGET }} | |
cargo build --release --workspace --target ${{ env.LINUX_TARGET }} | |
- name: Build (MacOS) | |
if: matrix.build == 'macos' | |
run: cargo build --release --workspace | |
- name: Build (MacOS ARM64) | |
if: matrix.build == 'macos_arm64' | |
run: | | |
rustup target add ${{ env.MACOS_ARM64_TARGET }} | |
cargo build --release --workspace --target ${{ env.MACOS_ARM64_TARGET }} | |
- name: Build (Windows) | |
if: matrix.build == 'windows' | |
run: cargo build --release --workspace | |
- name: Create artifact directory | |
run: | | |
mkdir ${{ env.RELEASE_DIR }} | |
mkdir dist | |
- name: Create tarball (Linux) | |
if: matrix.build == 'linux' | |
run: | | |
for bin in ${{ env.RELEASE_BINS }} | |
do | |
mv ./target/${{ env.LINUX_TARGET }}/release/${bin} ./dist/${bin} | |
done | |
mv ${{ env.RELEASE_ADDS }} ./dist | |
7z a -tzip ./${{ env.RELEASE_DIR }}/${{ env.RELEASE_BIN }}-${{ steps.get_version.outputs.VERSION }}-${{ env.LINUX_TARGET }}.zip ./dist | |
- name: Create tarball (Windows) | |
if: matrix.build == 'windows' | |
shell: bash | |
run: | | |
for bin in ${{ env.RELEASE_BINS }} | |
do | |
mv ./target/release/${bin}.exe ./dist/${bin}.exe | |
done | |
mv ${{ env.RELEASE_ADDS }} ./dist | |
7z a -tzip ./${{ env.RELEASE_DIR }}/${{ env.RELEASE_BIN }}-${{ steps.get_version.outputs.VERSION }}-${{ env.WINDOWS_TARGET }}.zip ./dist | |
- name: Create tarball (MacOS) | |
if: matrix.build == 'macos' | |
run: | | |
for bin in ${{ env.RELEASE_BINS }} | |
do | |
mv ./target/release/${bin} ./dist/${bin} | |
done | |
mv ${{ env.RELEASE_ADDS }} ./dist | |
7z a -tzip ./${{ env.RELEASE_DIR }}/${{ env.RELEASE_BIN }}-${{ steps.get_version.outputs.VERSION }}-${{ env.MACOS_TARGET }}.zip ./dist | |
- name: Create tarball (MacOS ARM64) | |
if: matrix.build == 'macos_arm64' | |
run: | | |
for bin in ${{ env.RELEASE_BINS }} | |
do | |
mv ./target/${{ env.MACOS_ARM64_TARGET }}/release/${bin} ./dist/${bin} | |
done | |
mv ${{ env.RELEASE_ADDS }} ./dist | |
7z a -tzip ./${{ env.RELEASE_DIR }}/${{ env.RELEASE_BIN }}-${{ steps.get_version.outputs.VERSION }}-${{ env.MACOS_ARM64_TARGET }}.zip ./dist | |
- name: Upload Zip | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.build }} | |
path: ./${{ env.RELEASE_DIR }} | |
release: | |
permissions: write-all | |
name: GitHub Release | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Query version number | |
id: get_version | |
shell: bash | |
run: | | |
echo "using version tag ${GITHUB_REF:10}" | |
echo "version=${GITHUB_REF:10}" >> $GITHUB_OUTPUT | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.get_version.outputs.VERSION }} | |
release_name: ${{ steps.get_version.outputs.VERSION }} | |
- name: Download Linux tarball | |
uses: actions/download-artifact@v4 | |
with: | |
name: linux | |
- name: Download Windows tarball | |
uses: actions/download-artifact@v4 | |
with: | |
name: windows | |
- name: Download MacOS tarball | |
uses: actions/download-artifact@v4 | |
with: | |
name: macos | |
- name: Download MacOS ARM64 tarball | |
uses: actions/download-artifact@v4 | |
with: | |
name: macos_arm64 | |
- name: Display Downloaded Artifacts | |
run: ls -R | |
- name: Release Linux tarball | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./${{ env.RELEASE_BIN }}-${{ steps.get_version.outputs.VERSION }}-${{ env.LINUX_TARGET }}.zip | |
asset_content_type: application/zip | |
asset_name: ${{ env.RELEASE_BIN }}-${{ steps.get_version.outputs.VERSION }}-${{ env.LINUX_TARGET }}.zip | |
- name: Release Windows tarball | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./${{ env.RELEASE_BIN }}-${{ steps.get_version.outputs.VERSION }}-${{ env.WINDOWS_TARGET }}.zip | |
asset_content_type: application/zip | |
asset_name: ${{ env.RELEASE_BIN }}-${{ steps.get_version.outputs.VERSION }}-${{ env.WINDOWS_TARGET }}.zip | |
- name: Release MacOS tarball | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./${{ env.RELEASE_BIN }}-${{ steps.get_version.outputs.VERSION }}-${{ env.MACOS_TARGET }}.zip | |
asset_content_type: application/zip | |
asset_name: ${{ env.RELEASE_BIN }}-${{ steps.get_version.outputs.VERSION }}-${{ env.MACOS_TARGET }}.zip | |
- name: Release MacOS ARM64 tarball | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./${{ env.RELEASE_BIN }}-${{ steps.get_version.outputs.VERSION }}-${{ env.MACOS_ARM64_TARGET }}.zip | |
asset_content_type: application/zip | |
asset_name: ${{ env.RELEASE_BIN }}-${{ steps.get_version.outputs.VERSION }}-${{ env.MACOS_ARM64_TARGET }}.zip | |