Skip to content

Fix missing dependency once again for Linux build. #13

Fix missing dependency once again for Linux build.

Fix missing dependency once again for Linux build. #13

Workflow file for this run

name: release-flow
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"
env:
EXECUTABLE_NAME: narrative-director-rs
OSX_APP_NAME: NarrativeDirector
jobs:
build-macOS:
runs-on: macOS-latest
env:
# macOS 11.0 Big Sur is the first version to support universal binaries
MACOSX_DEPLOYMENT_TARGET: 11.0
steps:
- name: Get tag
id: tag
uses: dawidd6/action-get-tag@v1
- name: Checkout repository
uses: actions/checkout@v3
- name: Install rust toolchain for Apple Silicon
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: aarch64-apple-darwin, x86_64-apple-darwin
- name: Build release for Apple Silicon
run: |
SDKROOT=$(xcrun -sdk macosx --show-sdk-path) cargo build --release --target=aarch64-apple-darwin
- name: Build release for x86 Apple
run: |
SDKROOT=$(xcrun -sdk macosx --show-sdk-path) cargo build --release --target=x86_64-apple-darwin
- name: Create Universal Binary
run: |
lipo -create -output target/release/${{ env.EXECUTABLE_NAME }} target/aarch64-apple-darwin/release/${{ env.EXECUTABLE_NAME }} target/x86_64-apple-darwin/release/${{ env.EXECUTABLE_NAME }}
- name: Create release
run: |
mkdir -p build/macos/src/App.app/Contents/MacOS/resources
cp -r resources/ build/macos/src/App.app/Contents/MacOS/resources
cp target/release/${{ env.EXECUTABLE_NAME }} build/macos/src/App.app/Contents/MacOS/
strip build/macos/src/App.app/Contents/MacOS/${{ env.EXECUTABLE_NAME }}
mv build/macos/src/App.app build/macos/src/${{ env.OSX_APP_NAME }}.app
ln -s /Applications build/macos/src/
hdiutil create -fs HFS+ -volname "${{ env.OSX_APP_NAME }}" -srcfolder build/macos/src ${{ env.EXECUTABLE_NAME }}.dmg
- name: Upload release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ env.EXECUTABLE_NAME }}.dmg
asset_name: ${{ env.EXECUTABLE_NAME }}_${{ steps.tag.outputs.tag }}_macOS.dmg
tag: ${{ github.ref }}
overwrite: true
build-linux:
runs-on: ubuntu-latest
steps:
- name: Get tag
id: tag
uses: dawidd6/action-get-tag@v1
- name: Checkout repository
uses: actions/checkout@v3
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt install -y \
libx11-dev \
libxext-dev \
libxft-dev \
libxinerama-dev \
libxcursor-dev \
libxrender-dev \
libxfixes-dev \
libpango1.0-dev \
libgl1-mesa-dev \
libglu1-mesa-dev \
libasound2-dev \
pkg-config \
libudev-dev \
libwayland-dev \
libxkbcommon-dev \
libdbus-1
- name: Build release
run: |
cargo build --release
- name: Prepare release
run: |
strip target/release/${{ env.EXECUTABLE_NAME }}
chmod +x target/release/${{ env.EXECUTABLE_NAME }}
mv target/release/${{ env.EXECUTABLE_NAME }} .
- name: Bundle release
run: |
tar -czf ${{ env.EXECUTABLE_NAME }}_linux.tar.gz ${{ env.EXECUTABLE_NAME }} resources
- name: Upload release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ env.EXECUTABLE_NAME }}_linux.tar.gz
asset_name: ${{ env.EXECUTABLE_NAME }}_${{ steps.tag.outputs.tag }}_linux.tar.gz
tag: ${{ github.ref }}
overwrite: true
build-windows:
runs-on: windows-latest
steps:
- name: Get tag
id: tag
uses: dawidd6/action-get-tag@v1
- name: Checkout repository
uses: actions/checkout@v3
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Build release
run: |
cargo build --release
- name: Prepare release
run: |
mkdir target/release/resources && cp -r resources target/release/resources
- name: Zip release
uses: vimtor/action-zip@v1
with:
files: target/release/resources/ target/release/${{ env.EXECUTABLE_NAME }}.exe
dest: ${{ env.EXECUTABLE_NAME }}_windows.zip
- name: Upload release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ env.EXECUTABLE_NAME }}_windows.zip
asset_name: ${{ env.EXECUTABLE_NAME }}_${{ steps.tag.outputs.tag }}_windows.zip
tag: ${{ github.ref }}
overwrite: true