chore(release): prepare for 0.7.1 #97
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
name: Build App & Release | |
on: | |
push: | |
tags: | |
- "v*.*.*" | |
branches: | |
- development | |
workflow_dispatch: | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
build: | |
runs-on: ${{ matrix.os-target.os }} | |
strategy: | |
matrix: | |
os-target: | |
- os: ubuntu-latest | |
target: x86_64-unknown-linux-gnu | |
- os: windows-latest | |
target: x86_64-pc-windows-msvc | |
- os: macos-latest | |
target: x86_64-apple-darwin | |
- os: macos-latest | |
target: aarch64-apple-darwin | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Conda (windows) | |
if: matrix.os-target.os == 'windows-latest' | |
uses: s-weigand/setup-conda@v1 | |
with: | |
activate-conda: false | |
- name: Install pdftotext dependencies (windows) | |
if: matrix.os-target.os == 'windows-latest' | |
run: | | |
conda install -c conda-forge poppler | |
- name: Install ocrmypdf dependencies (windows) | |
uses: MinoruSekine/[email protected] | |
if: matrix.os-target.os == 'windows-latest' | |
with: | |
apps: tesseract pdfquant ghostscript | |
- name: Setup brew (mac) | |
if: matrix.os-target.os == 'macos-latest' | |
uses: Homebrew/actions/setup-homebrew@master | |
- name: Install pdftotext dependencies (mac) | |
if: matrix.os-target.os == 'macos-latest' | |
run: brew install poppler ocrmypdf | |
- name: Install pdftotext dependencies (ubuntu) | |
if: matrix.os-target.os == 'ubuntu-latest' | |
uses: daaku/gh-action-apt-install@v4 | |
with: | |
packages: build-essential libpoppler-cpp-dev pkg-config ocrmypdf | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: stable | |
target: ${{ matrix.os-target.target }} | |
- name: Install Statement Sensei dependencies | |
uses: ./.github/actions/setup-python-poetry | |
with: | |
python-version: "3.11" | |
poetry-version: "1.8.3" | |
poetry-install-args: --with main --with build --without dev --extras ocrmypdf | |
# onedir mode doesn't work with ubuntu, build_appimage.sh fails | |
- name: Create executable for tauri (ubuntu) | |
if: matrix.os-target.os == 'ubuntu-latest' | |
run: | | |
poetry run pyinstaller entrypoint.onefile.spec | |
cp dist/entrypoint ./tauri/src-tauri/binaries/statementsensei-${{ matrix.os-target.target }} | |
- name: Create executable for tauri (windows) | |
if: matrix.os-target.os == 'windows-latest' | |
run: | | |
poetry run pyinstaller entrypoint.spec | |
cp dist/entrypoint/entrypoint ./tauri/src-tauri/binaries/statementsensei-${{ matrix.os-target.target }} | |
cp -r dist/entrypoint/_internal ./tauri/src-tauri/binaries/ | |
# onedir mode doesn't work with macos due to missing Python framework | |
- name: Create executable for tauri (macos) | |
if: matrix.os-target.os == 'macos-latest' | |
run: | | |
poetry run pyinstaller entrypoint.onefile.spec | |
cp dist/entrypoint ./tauri/src-tauri/binaries/statementsensei-${{ matrix.os-target.target }} | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
cache-on-failure: true | |
workspaces: tauri/src-tauri | |
- name: Install tauri dependencies (ubuntu) | |
if: matrix.os-target.os == 'ubuntu-latest' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y javascriptcoregtk-4.1 libsoup-3.0 webkit2gtk-4.1 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 9.0.6 | |
run_install: false | |
- name: Install tauri | |
working-directory: tauri | |
run: pnpm install | |
- name: Build tauri app | |
working-directory: tauri/src-tauri/ | |
run: pnpm tauri build -t ${{ matrix.os-target.target }} | |
- name: Upload tauri app | |
id: artifact_upload | |
uses: actions/upload-artifact@v4 | |
with: | |
name: statementsensei-${{ matrix.os-target.target }} | |
path: | | |
tauri/src-tauri/target/${{ matrix.os-target.target }}/release/bundle/deb/ | |
tauri/src-tauri/target/${{ matrix.os-target.target }}/release/bundle/nsis/ | |
tauri/src-tauri/target/${{ matrix.os-target.target }}/release/bundle/dmg/ | |
compression-level: 9 | |
create_release: | |
if: github.ref != 'refs/heads/development' | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
- name: Download all artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: ./artifacts | |
merge-multiple: true | |
- name: Get Statement Sensei version | |
id: statement_sensei_version | |
run: echo "statement_sensei_version=$(grep "^version" pyproject.toml | cut -d'"' -f2)" >> $GITHUB_OUTPUT | |
- name: Create release changelog | |
run: | | |
pip install git-cliff==2.4.0 | |
git fetch --tags | |
git cliff --latest > RELEASE_CHANGELOG.md | |
- name: Create a Github Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: v${{ steps.statement_sensei_version.outputs.statement_sensei_version }} | |
target_commitish: main | |
body_path: RELEASE_CHANGELOG.md | |
files: ./artifacts/**/StatementSensei* |