Merge pull request #458 from pixil98/master

Deb build tweaks, Docker read me
This commit is contained in:
rmcrackan 2023-01-23 08:06:51 -05:00 committed by GitHub
commit 501ae643f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 54 additions and 42 deletions

View File

@ -15,10 +15,6 @@ on:
description: 'Skip running unit tests'
required: false
default: true
outputs:
version:
description: "The Libation version number"
value: ${{ jobs.build.outputs.version }}
env:
DOTNET_CONFIGURATION: 'Release'
@ -27,8 +23,6 @@ env:
jobs:
build:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get_version.outputs.version }}
strategy:
matrix:
os: [Linux, MacOS]

View File

@ -15,10 +15,6 @@ on:
description: 'Skip running unit tests'
required: false
default: true
outputs:
version:
description: "The Libation version number"
value: ${{ jobs.build.outputs.version }}
env:
DOTNET_CONFIGURATION: 'Release'
@ -27,8 +23,6 @@ env:
jobs:
build:
runs-on: windows-latest
outputs:
version: ${{ steps.get_version.outputs.version }}
strategy:
matrix:
os: [Windows]

View File

@ -15,11 +15,6 @@ on:
description: 'Skip running unit tests'
required: false
default: true
build_deb:
type: boolean
description: 'Build Debian package'
required: false
default: false
jobs:
windows:
@ -33,11 +28,3 @@ jobs:
with:
version_override: ${{ inputs.version_override }}
run_unit_tests: ${{ inputs.run_unit_tests }}
linux_deb:
needs: [linux]
if: inputs.build_deb
uses: ./.github/workflows/build-deb.yml
with:
version: ${{ needs.linux.outputs.version }}

View File

@ -1,7 +1,7 @@
# build-deb.yml
# deb.yml
# Reusable workflow that builds the Linux Debian package.
---
name: build_deb
name: deb
on:
workflow_call:
@ -21,15 +21,14 @@ jobs:
- uses: actions/checkout@v3
- name: Download Artifact
uses: actions/download-artifact@master
uses: actions/download-artifact@v3
with:
name: "${{ env.FILE_NAME }}.tar.gz"
- name: Build .deb
id: deb
run: |
chmod +x ./.github/workflows/scripts/targz2deb.sh
./.github/workflows/scripts/targz2deb.sh "${{ env.FILE_NAME }}.tar.gz" ${{ inputs.version }}
./Scripts/targz2deb.sh "${{ env.FILE_NAME }}.tar.gz" ${{ inputs.version }}
- name: Publish .deb
uses: actions/upload-artifact@v3

View File

@ -33,10 +33,15 @@ jobs:
with:
version_override: ${{ needs.prerelease.outputs.version }}
run_unit_tests: false
build_deb: true
deb:
needs: [prerelease,build]
uses: ./.github/workflows/deb.yml
with:
version: ${{ needs.prerelease.outputs.version }}
release:
needs: [prerelease,build]
needs: [prerelease,build,deb]
runs-on: ubuntu-latest
steps:
- name: Download artifacts
@ -44,14 +49,11 @@ jobs:
with:
path: artifacts
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
- name: Release
id: release
uses: softprops/action-gh-release@v1
with:
tag_name: '${{ github.ref }}'
release_name: 'Libation ${{ needs.prerelease.outputs.version }}'
name: Libation ${{ needs.prerelease.outputs.version }}
body: <Put a body here>
draft: true
prerelease: false
@ -61,5 +63,5 @@ jobs:
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
with:
release_id: '${{ steps.create_release.outputs.id }}'
release_id: '${{ steps.release.outputs.id }}'
assets_path: ./artifacts

36
Documentation/Docker.md Normal file
View File

@ -0,0 +1,36 @@
## [Download Libation](https://github.com/rmcrackan/Libation/releases/latest)
### If you found this useful, tell a friend. If you found this REALLY useful, you can click here to [PalPal.me](https://paypal.me/mcrackan?locale.x=en_us)
...or just tell more friends. As long as I'm maintaining this software, it will remain **free** and **open source**.
### Setup
In order to use the docker image, you'll need to provide it with a copy of the `AccountsSettings.json`, `Settings.json`, and `LibationContext.db` files. These files can usually be found in the Libation folder in your user's home directory. If you haven't run Libation yet, you'll need to launch it to generate these files and setup your accounts. Once you have them, copy these files to a new location, such as `/opt/libation/config`. Before using them we'll need to make a couple edits so that the filepaths referenced are correct when running from the docker image.
In Settings.json, make the following changes:
* Change `Books` to `/data`
* Change `InProgress` to `/tmp`
### Running
Once the configuration files are copied and edited, the docker image can be run with the following command.
```
sudo docker run -d \
-v /opt/libation/config:/config \
-v /opt/libation/books:/data \
--name libation \
--restart=always \
rmcrackan/libation
```
By default the container will scan for new books every 30 minutes and download any new ones. This is configurable by passing in a value for the `SLEEP_TIME` environment variable. Additionally, if you pass in `-1` it will scan and download books once and then exit.
```
sudo docker run -d \
-v /opt/libation/config:/config \
-v /opt/libation/books:/data \
-e SLEEP_TIME='10m' \
--name libation \
--restart=always \
rmcrackan/libation
```

View File