From 6cfd2dea9685272aaf1a9c9be08b972a7acee323 Mon Sep 17 00:00:00 2001 From: Aaron Reisman Date: Sun, 22 Jan 2023 13:01:12 -0600 Subject: [PATCH 01/10] Move deb building out of the build pipeline --- .github/workflows/build-linux.yml | 4 ---- .github/workflows/build-windows.yml | 8 +------- .github/workflows/build.yml | 15 +-------------- .github/workflows/{build-deb.yml => deb.yml} | 9 ++++----- .github/workflows/release.yml | 7 ++++++- .../workflows/scripts => Scripts}/targz2deb.sh | 0 6 files changed, 12 insertions(+), 31 deletions(-) rename .github/workflows/{build-deb.yml => deb.yml} (74%) rename {.github/workflows/scripts => Scripts}/targz2deb.sh (100%) mode change 100644 => 100755 diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index b9b7cf37..2c9ffa2d 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -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' diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index cfac74ec..f82aa21e 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -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] @@ -74,7 +68,7 @@ jobs: - name: Zip artifact id: zip working-directory: ./Source/bin/Publish - run: | + run: | $dir = "${{ matrix.os }}-${{ matrix.release_name }}\" $delfiles = @("libmp3lame.so", "ffmpegaac.so", "glass-with-glow_256.svg", "Libation.desktop") foreach ($file in $delfiles){ if (test-path $dir$file){ Remove-Item $dir$file } } diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 37707947..b6cf9787 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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: @@ -32,12 +27,4 @@ jobs: uses: ./.github/workflows/build-linux.yml 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 }} - + run_unit_tests: ${{ inputs.run_unit_tests }} diff --git a/.github/workflows/build-deb.yml b/.github/workflows/deb.yml similarity index 74% rename from .github/workflows/build-deb.yml rename to .github/workflows/deb.yml index e1e3db3d..3557b629 100644 --- a/.github/workflows/build-deb.yml +++ b/.github/workflows/deb.yml @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 564c8b03..ba061933 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,7 +33,12 @@ jobs: with: version_override: ${{ needs.prerelease.outputs.version }} run_unit_tests: false - build_deb: true + + deb: + needs: [prerelease,build] + uses: ./.github/workflows/build-deb.yml + with: + version: ${{ needs.prerelease.outputs.version }} release: needs: [prerelease,build] diff --git a/.github/workflows/scripts/targz2deb.sh b/Scripts/targz2deb.sh old mode 100644 new mode 100755 similarity index 100% rename from .github/workflows/scripts/targz2deb.sh rename to Scripts/targz2deb.sh From 5935b40b609b4990201c93ae5678bbea229e7c04 Mon Sep 17 00:00:00 2001 From: Aaron Reisman Date: Sun, 22 Jan 2023 13:03:23 -0600 Subject: [PATCH 02/10] Remove output version --- .github/workflows/build-linux.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index 2c9ffa2d..93f235f8 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -23,8 +23,6 @@ env: jobs: build: runs-on: ubuntu-latest - outputs: - version: ${{ steps.get_version.outputs.version }} strategy: matrix: os: [Linux, MacOS] From 00339127aabd857049e89a5dc873402a0b1f1a97 Mon Sep 17 00:00:00 2001 From: Aaron Reisman Date: Sun, 22 Jan 2023 13:15:51 -0600 Subject: [PATCH 03/10] reference correct deb yaml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ba061933..d39d48f0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -36,7 +36,7 @@ jobs: deb: needs: [prerelease,build] - uses: ./.github/workflows/build-deb.yml + uses: ./.github/workflows/deb.yml with: version: ${{ needs.prerelease.outputs.version }} From 8c59e1280b8de20b1c0404f5f530614de06807da Mon Sep 17 00:00:00 2001 From: Aaron Reisman Date: Sun, 22 Jan 2023 13:20:59 -0600 Subject: [PATCH 04/10] Wait for deb to be finished before releasing --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d39d48f0..c292a591 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,7 +41,7 @@ jobs: version: ${{ needs.prerelease.outputs.version }} release: - needs: [prerelease,build] + needs: [prerelease,build,deb] runs-on: ubuntu-latest steps: - name: Download artifacts From b1a37cbd8c1e6f7671cf80d388b2f2696c98c5a5 Mon Sep 17 00:00:00 2001 From: Aaron Reisman Date: Sun, 22 Jan 2023 13:56:36 -0600 Subject: [PATCH 05/10] Switch to a still maintained release action --- .github/workflows/release.yml | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c292a591..9eb5b777 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -49,22 +49,10 @@ jobs: with: path: artifacts - - name: Create release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' + - name: Release + uses: softprops/action-gh-release@v1 with: - tag_name: '${{ github.ref }}' - release_name: 'Libation ${{ needs.prerelease.outputs.version }}' body: draft: true prerelease: false - - - name: Upload release assets - uses: dwenegar/upload-release-assets@v1 - env: - GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' - with: - release_id: '${{ steps.create_release.outputs.id }}' - assets_path: ./artifacts + files: ./artifacts/* From 01f6f5c137bcb60dc05c6cef9a596bde8dce8b46 Mon Sep 17 00:00:00 2001 From: Aaron Reisman Date: Sun, 22 Jan 2023 14:17:08 -0600 Subject: [PATCH 06/10] Add name to release --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9eb5b777..21435284 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -52,6 +52,7 @@ jobs: - name: Release uses: softprops/action-gh-release@v1 with: + name: Libation ${{ needs.prerelease.outputs.version }} body: draft: true prerelease: false From a04538710f28300fb496b4e6d3c530826ce1aa95 Mon Sep 17 00:00:00 2001 From: Aaron Reisman Date: Sun, 22 Jan 2023 14:53:05 -0600 Subject: [PATCH 07/10] Try with a different glob --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 21435284..febfe804 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -56,4 +56,4 @@ jobs: body: draft: true prerelease: false - files: ./artifacts/* + files: artifacts/* From b6b29309c9d11ad923f429da0c12559624601ec0 Mon Sep 17 00:00:00 2001 From: Aaron Reisman Date: Sun, 22 Jan 2023 15:15:56 -0600 Subject: [PATCH 08/10] Go back to the old way of uploading assets --- .github/workflows/release.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index febfe804..f9f8044f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -56,4 +56,11 @@ jobs: body: draft: true prerelease: false - files: artifacts/* + + - name: Upload release assets + uses: dwenegar/upload-release-assets@v1 + env: + GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' + with: + release_id: '${{ steps.create_release.outputs.id }}' + assets_path: ./artifacts From 17103ed066c1bc511d094e5ba0ccceecf66508c6 Mon Sep 17 00:00:00 2001 From: Aaron Reisman Date: Sun, 22 Jan 2023 15:33:27 -0600 Subject: [PATCH 09/10] Get release id correctly --- .github/workflows/release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f9f8044f..29888cd9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -50,6 +50,7 @@ jobs: path: artifacts - name: Release + id: release uses: softprops/action-gh-release@v1 with: name: Libation ${{ needs.prerelease.outputs.version }} @@ -62,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 From 400074170e1945cb7ffa5c308c5b385fb4493f48 Mon Sep 17 00:00:00 2001 From: Aaron Reisman Date: Sun, 22 Jan 2023 17:09:25 -0600 Subject: [PATCH 10/10] Add docker readme --- Documentation/Docker.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Documentation/Docker.md diff --git a/Documentation/Docker.md b/Documentation/Docker.md new file mode 100644 index 00000000..2dc0737a --- /dev/null +++ b/Documentation/Docker.md @@ -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 +``` +