Skip to content

Commit

Permalink
Release v0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
avsaase committed Mar 23, 2024
1 parent 345deac commit 1044026
Show file tree
Hide file tree
Showing 5 changed files with 133 additions and 121 deletions.
127 changes: 127 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
name: Build

on:
push:
branches:
- master
tags-ignore:
- "**"
workflow_call:

jobs:
build:
name: Build
strategy:
fail-fast: false
matrix:
targets:
[
{
name: windows64,
fancy_name: windows,
runner: windows-latest,
target: x86_64-pc-windows-msvc,
ffmpeg_filename: ffmpeg-6.0-essentials_build.7z,
ffprobe_filename: "",
},
{
name: macos-intel,
fancy_name: macos-intel,
runner: macos-latest,
target: x86_64-apple-darwin,
ffmpeg_filename: ffmpeg6intel.zip,
ffprobe_filename: ffprobe6intel.zip,
},
{
name: macos-arm,
fancy_name: macos-apple-silicon,
runner: macos-latest,
target: aarch64-apple-darwin,
ffmpeg_filename: ffmpeg6arm.zip,
ffprobe_filename: ffprobe6arm.zip,
},
]
runs-on: ${{ matrix.targets.runner }}
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
override: true
target: ${{ matrix.targets.target }}

- name: Cache dependencies
id: extcache
uses: Swatinem/rust-cache@v2
with:
cache-directories: ${{ github.workspace }}/ext/
prefix-key: "v1"

- name: Install cargo-binstall
uses: taiki-e/install-action@v2
with:
tool: cargo-binstall

- name: Install cargo-wix
if: ${{ matrix.targets.name == 'windows64' }}
run: cargo binstall cargo-wix --no-confirm --force

- name: Install cargo-bundle
if: ${{ matrix.targets.name == 'macos-intel' || matrix.targets.name == 'macos-arm'}}
run: cargo binstall cargo-bundle --no-confirm --force

- name: Build (Windows)
if: ${{ matrix.targets.name == 'windows64'}}
run: cargo build --release --features windows-installer

- name: Build (MacOS)
if: ${{ matrix.targets.name == 'macos-intel' || matrix.targets.name == 'macos-arm'}}
run: cargo build --release --target ${{ matrix.targets.target }} --features macos-app-bundle

- name: Extract ffmpeg
run: |
cd ${{ github.workspace }}/ext/ffmpeg/${{ matrix.targets.name }}
7z x ${{ matrix.targets.ffmpeg_filename }} -aoa
- name: Extract ffprobe
if: ${{ matrix.targets.name == 'macos-intel' || matrix.targets.name == 'macos-arm' }}
run: |
cd ${{ github.workspace }}/ext/ffmpeg/${{ matrix.targets.name }}
7z x ${{ matrix.targets.ffprobe_filename }} -aoa
- name: Create Windows installer
if: ${{ matrix.targets.name == 'windows64'}}
continue-on-error: true
run: |
cargo wix --package walksnail-osd-tool --include _deploy\windows\wix\main.wxs --nocapture --no-build
cd ${{ github.workspace }}/target/wix/
7z a temp.zip *.msi
mv temp.zip ${{ github.workspace }}/_deploy/walksnail-osd-tool-${{ matrix.targets.fancy_name }}.zip
shell: cmd

- name: Create Mac App bundle
if: ${{ matrix.targets.name == 'macos-intel' || matrix.targets.name == 'macos-arm'}}
run: |
cd ./ui
cargo bundle --release --target ${{ matrix.targets.target }} --features macos-app-bundle
cp ${{ github.workspace }}/ext/ffmpeg/${{ matrix.targets.name }}/ffmpeg ${{ github.workspace }}/target/${{ matrix.targets.target }}/release/bundle/osx/Walksnail\ OSD\ Tool.app/Contents/MacOS/ffmpeg
cp ${{ github.workspace }}/ext/ffmpeg/${{ matrix.targets.name }}/ffprobe ${{ github.workspace }}/target/${{ matrix.targets.target }}/release/bundle/osx/Walksnail\ OSD\ Tool.app/Contents/MacOS/ffprobe
cd ${{ github.workspace }}/target/${{ matrix.targets.target }}/release/bundle/osx/
codesign --force -s - Walksnail\ OSD\ Tool.app/Contents/MacOS/ffmpeg
codesign --force -s - Walksnail\ OSD\ Tool.app/Contents/MacOS/ffprobe
codesign --force -s - Walksnail\ OSD\ Tool.app/Contents/MacOS/walksnail-osd-tool
codesign --force -s - Walksnail\ OSD\ Tool.app
7z a temp.zip Walksnail\ OSD\ Tool.app
mv temp.zip ${{ github.workspace }}/_deploy/walksnail-osd-tool-${{ matrix.targets.fancy_name }}.zip
- name: Save binaries
uses: actions/upload-artifact@v3
with:
name: walksnail-osd-tool-all-platforms
path: ${{ github.workspace }}/_deploy/*.*
121 changes: 3 additions & 118 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,130 +5,15 @@ permissions:

on:
push:
branches: master
pull_request:
tags:
- "v*"

jobs:
build:
name: Build
strategy:
fail-fast: false
matrix:
targets:
[
{
name: windows64,
fancy_name: windows,
runner: windows-latest,
target: x86_64-pc-windows-msvc,
ffmpeg_filename: ffmpeg-6.0-essentials_build.7z,
ffprobe_filename: "",
},
{
name: macos-intel,
fancy_name: macos-intel,
runner: macos-latest,
target: x86_64-apple-darwin,
ffmpeg_filename: ffmpeg6intel.zip,
ffprobe_filename: ffprobe6intel.zip,
},
{
name: macos-arm,
fancy_name: macos-apple-silicon,
runner: macos-latest,
target: aarch64-apple-darwin,
ffmpeg_filename: ffmpeg6arm.zip,
ffprobe_filename: ffprobe6arm.zip,
},
]
runs-on: ${{ matrix.targets.runner }}
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
override: true
target: ${{ matrix.targets.target }}

- name: Cache dependencies
id: extcache
uses: Swatinem/rust-cache@v2
with:
cache-directories: ${{ github.workspace }}/ext/
prefix-key: "v1"

- name: Install cargo-binstall
uses: taiki-e/install-action@v2
with:
tool: cargo-binstall

- name: Install cargo-wix
if: ${{ matrix.targets.name == 'windows64' }}
run: cargo binstall cargo-wix --no-confirm --force

- name: Install cargo-bundle
if: ${{ matrix.targets.name == 'macos-intel' || matrix.targets.name == 'macos-arm'}}
run: cargo binstall cargo-bundle --no-confirm --force

- name: Build (Windows)
if: ${{ matrix.targets.name == 'windows64'}}
run: cargo build --release --features windows-installer

- name: Build (MacOS)
if: ${{ matrix.targets.name == 'macos-intel' || matrix.targets.name == 'macos-arm'}}
run: cargo build --release --target ${{ matrix.targets.target }} --features macos-app-bundle

- name: Extract ffmpeg
run: |
cd ${{ github.workspace }}/ext/ffmpeg/${{ matrix.targets.name }}
7z x ${{ matrix.targets.ffmpeg_filename }} -aoa
- name: Extract ffprobe
if: ${{ matrix.targets.name == 'macos-intel' || matrix.targets.name == 'macos-arm' }}
run: |
cd ${{ github.workspace }}/ext/ffmpeg/${{ matrix.targets.name }}
7z x ${{ matrix.targets.ffprobe_filename }} -aoa
- name: Create Windows installer
if: ${{ matrix.targets.name == 'windows64'}}
continue-on-error: true
run: |
cargo wix --package walksnail-osd-tool --include _deploy\windows\wix\main.wxs --nocapture --no-build
cd ${{ github.workspace }}/target/wix/
7z a temp.zip *.msi
mv temp.zip ${{ github.workspace }}/_deploy/walksnail-osd-tool-${{ matrix.targets.fancy_name }}.zip
shell: cmd

- name: Create Mac App bundle
if: ${{ matrix.targets.name == 'macos-intel' || matrix.targets.name == 'macos-arm'}}
run: |
cd ./ui
cargo bundle --release --target ${{ matrix.targets.target }} --features macos-app-bundle
cp ${{ github.workspace }}/ext/ffmpeg/${{ matrix.targets.name }}/ffmpeg ${{ github.workspace }}/target/${{ matrix.targets.target }}/release/bundle/osx/Walksnail\ OSD\ Tool.app/Contents/MacOS/ffmpeg
cp ${{ github.workspace }}/ext/ffmpeg/${{ matrix.targets.name }}/ffprobe ${{ github.workspace }}/target/${{ matrix.targets.target }}/release/bundle/osx/Walksnail\ OSD\ Tool.app/Contents/MacOS/ffprobe
cd ${{ github.workspace }}/target/${{ matrix.targets.target }}/release/bundle/osx/
codesign --force -s - Walksnail\ OSD\ Tool.app/Contents/MacOS/ffmpeg
codesign --force -s - Walksnail\ OSD\ Tool.app/Contents/MacOS/ffprobe
codesign --force -s - Walksnail\ OSD\ Tool.app/Contents/MacOS/walksnail-osd-tool
codesign --force -s - Walksnail\ OSD\ Tool.app
7z a temp.zip Walksnail\ OSD\ Tool.app
mv temp.zip ${{ github.workspace }}/_deploy/walksnail-osd-tool-${{ matrix.targets.fancy_name }}.zip
- name: Save binaries
uses: actions/upload-artifact@v3
with:
name: walksnail-osd-tool-all-platforms
path: ${{ github.workspace }}/_deploy/*.*
uses: ./.github/workflows/build.yaml

release:
name: Create GitHub release
if: startsWith(github.ref, 'refs/tags/')
needs: build
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
## [0.3.0] - 2024-03-23

### Added

Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ui/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "walksnail-osd-tool"
version = "0.2.0"
version = "0.3.0"
edition = "2021"
description = "Cross-platform tool for rendering the flight controller OSD and SRT data from the Walksnail Avatar HD FPV system on top of the goggle or VRX recording."
authors = ["Alexander van Saase"]
Expand Down

0 comments on commit 1044026

Please sign in to comment.