hydrus/.github/workflows/release.yml

136 lines
4.2 KiB
YAML
Raw Normal View History

2021-04-14 04:19:32 +00:00
name: Release
on:
push:
tags:
- 'v*'
jobs:
build-windows:
runs-on: windows-2019
steps:
-
name: Checkout
2022-10-19 20:44:13 +00:00
uses: actions/checkout@v3
with:
path: hydrus
-
name: Setup FFMPEG
2022-10-19 20:44:13 +00:00
uses: FedericoCarboni/setup-ffmpeg@v1.1.0
id: setup_ffmpeg
with:
token: ${{ secrets.GITHUB_TOKEN }}
-
name: Setup Python
2022-10-19 20:44:13 +00:00
uses: actions/setup-python@v4
with:
python-version: 3.9
architecture: x64
-
2022-10-19 20:44:13 +00:00
name: Pip Install
run: python3 -m pip install -r hydrus/static/build_files/windows/requirements.txt
2022-10-19 20:44:13 +00:00
-
name: Build docs to /help
run: mkdocs build -d help
working-directory: hydrus
2022-10-19 20:44:13 +00:00
#-
# name: Cache Qt
# id: cache_qt
# uses: actions/cache@v1
# with:
# path: ../Qt
# key: ${{ runner.os }}-QtCache
#-
# name: Install Qt
# uses: jurplel/install-qt-action@v2
# with:
# install-deps: true
# setup-python: 'false'
# modules: qtcharts qtwidgets qtgui qtcore
# cached: ${{ steps.cache_qt.outputs.cache-hit }}
-
name: Download mpv-dev
2022-10-19 20:44:13 +00:00
uses: carlosperate/download-file-action@v1.1.1
id: download_mpv
with:
2022-09-28 17:15:23 +00:00
file-url: 'https://sourceforge.net/projects/mpv-player-windows/files/libmpv/mpv-dev-x86_64-20220501-git-9ffaa6b.7z'
file-name: 'mpv-dev-x86_64.7z'
location: '.'
-
name: Process mpv-dev
run: |
7z x ${{ steps.download_mpv.outputs.file-path }}
move mpv-2.dll hydrus\
-
name: Build Hydrus
run: |
move ${{ steps.setup_ffmpeg.outputs.ffmpeg-path }} hydrus\bin\
move hydrus\static\build_files\windows\sqlite3.dll hydrus\
move hydrus\static\build_files\windows\sqlite3.exe hydrus\db
move hydrus\static\build_files\windows\client-win.spec client-win.spec
move hydrus\static\build_files\windows\server-win.spec server-win.spec
pyinstaller server-win.spec
pyinstaller client-win.spec
dir -r
2022-08-24 21:06:25 +00:00
-
# yo pretty sure we'll need to install this manually once we are on windows server 2022
# https://github.com/actions/virtual-environments/issues/4856
name: InnoSetup
run: |
move hydrus\static\build_files\windows\InnoSetup.iss InnoSetup.iss
ISCC.exe InnoSetup.iss /DVersion=${{ github.ref_name }}
-
name: Compress Client
run: |
cd .\dist
7z.exe a -tzip -mm=Deflate -mx=5 ..\Windows-Extract.zip 'Hydrus Network'
cd ..
2022-08-24 21:06:25 +00:00
-
name: Upload a Build Artifact
2022-10-19 20:44:13 +00:00
uses: actions/upload-artifact@v3
2022-08-24 21:06:25 +00:00
with:
name: Windows-Install
path: dist\HydrusInstaller.exe
if-no-files-found: error
retention-days: 2
-
name: Upload a Build Artifact
2022-10-19 20:44:13 +00:00
uses: actions/upload-artifact@v3
with:
name: Windows-Extract
path: Windows-Extract.zip
if-no-files-found: error
retention-days: 2
2021-04-14 04:19:32 +00:00
create-release:
name: Create Release Entry
runs-on: ubuntu-20.04
2022-11-09 23:32:19 +00:00
needs: [build-windows]
2021-04-14 04:19:32 +00:00
steps:
-
name: Checkout code
2022-10-19 20:44:13 +00:00
uses: actions/checkout@v3
-
name: Get All Artifacts
2022-10-19 20:44:13 +00:00
uses: actions/download-artifact@v3
-
name: Extract version metadata
2021-04-14 04:19:32 +00:00
id: meta
run: |
2022-10-19 20:44:13 +00:00
echo "version=${GITHUB_REF##*/}" >> $GITHUB_ENV
echo "version_short=${GITHUB_REF##*/v}" >> $GITHUB_ENV
-
name: Rename Files
2021-04-14 04:19:32 +00:00
run: |
mkdir ubuntu windows
2022-10-26 20:43:00 +00:00
mv Windows-Install/HydrusInstaller.exe Hydrus.Network.${{ env.version_short }}.-.Windows.-.Installer.exe
mv Windows-Extract/Windows-Extract.zip Hydrus.Network.${{ env.version_short }}.-.Windows.-.Extract.only.zip
-
name: Release new
2021-04-14 04:19:32 +00:00
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
2022-10-26 20:43:00 +00:00
Hydrus.Network.${{ env.version_short }}.-.Windows.-.Installer.exe
Hydrus.Network.${{ env.version_short }}.-.Windows.-.Extract.only.zip
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}