Skip to content

Build full release package #12

Build full release package

Build full release package #12

name: "Build full release package"
on:
workflow_dispatch:
inputs:
release_tag:
description: "Release tag to build the full package for"
required: true
type: string
default: "latest"
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
RELEASE_TAG: ${{ inputs.release_tag || 'latest' }}
jobs:
build-full-package:
name: "Build full package"
runs-on: "ubuntu-latest"
steps:
- name: Checkout main repo for gh release
uses: actions/checkout@v4
# do not use LFS here (not needed + save bandwidth)
- name: "Setup stage directory"
shell: bash
run: |
mkdir -p stage/licenses
mv LICENSE stage/licenses/preppipe_LICENSE.txt
mv ci/README_dist.txt stage/README.txt
- name: "Checkout document repo"
uses: actions/checkout@v4
with:
repository: "PrepPipe/preppipe-docs"
path: docs_mkdocs
- name: "Download main repo artifacts"
uses: robinraju/release-downloader@v1.10
with:
repository: "PrepPipe/preppipe-python"
tag: "${{ env.RELEASE_TAG }}"
fileName: "preppipe-*.7z*" # accept both 7z and 7z.001
tarBall: false
zipBall: false
out-file-path: "."
- name: "Download assets"
uses: robinraju/release-downloader@v1.10
with:
repository: "PrepPipe/preppipe-python"
tag: "${{ env.RELEASE_TAG }}"
fileName: "builtin-assets-packed.7z.*"
tarBall: false
zipBall: false
out-file-path: "."
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '>= 3.10'
- name: Install document building dependencies
run: |
python -m pip install --upgrade pip
python3 -m pip install mkdocs
python3 -m pip install mkdocs-material
python3 -m pip install mkdocs-static-i18n[material]
python3 -m pip install mkdocs-ezlinks-plugin
- name: "Build Documents"
run: |
7z x preppipe-docs-overlay.7z.001 -y -odocs_mkdocs
cd docs_mkdocs && mkdocs build -f mkdocs.yml && cd ..
mv docs_mkdocs/generated stage/docs
# now document files are in stage/docs
- name: "Download ffmpeg"
uses: robinraju/release-downloader@v1.10
with:
repository: "PrepPipe/preppipe-thirdparty-bins"
tag: "latest"
fileName: "ffmpeg-master-latest-win64-lgpl-shared.zip"
tarBall: false
zipBall: false
out-file-path: "."
- name: "Extract ffmpeg"
shell: bash
run: |
unzip ffmpeg-master-latest-win64-lgpl-shared.zip "ffmpeg-master-latest-win64-lgpl-shared/*" -d "windows-x64"
mv windows-x64/ffmpeg-master-latest-win64-lgpl-shared/bin/* windows-x64/
mkdir -p windows-x64/licenses
mv windows-x64/ffmpeg-master-latest-win64-lgpl-shared/LICENSE.txt windows-x64/licenses/ffmpeg_LICENSE.txt
rm -rf windows-x64/ffmpeg-master-latest-win64-lgpl-shared
rm -f ffmpeg-master-latest-win64-lgpl-shared.zip
- name: "Combine all files and upload"
shell: bash
env:
GH_TOKEN: ${{ github.token }} # required for gh release
run: |
mkdir dist
7z x preppipe-windows-x64.7z -y -owindows-x64
rm -f preppipe-windows-x64.7z
7z x builtin-assets-packed.7z.001 -y -owindows-x64/_internal
rm -f builtin-assets-packed.7z.*
cp -r stage/* windows-x64
cd windows-x64 && 7z a -t7z -mx=9 ../dist/preppipe-windows-x64-full.7z * -v2000m && cd ..
gh release upload "${{ env.RELEASE_TAG }}" dist/preppipe-windows-x64-full.7z.* --clobber
rm -rf windows-x64