Skip to content

Commit

Permalink
Merge pull request #122 from Weilbyte/next
Browse files Browse the repository at this point in the history
Offline bundle
  • Loading branch information
Weilbyte authored Mar 19, 2022
2 parents 961d531 + 7e01221 commit a3b8d7b
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/offline_bundle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Offline Bundle

on:
push:
branches: [main]
release:
types: [published]
schedule:
- cron: '0 0 1 * *'

jobs:
Bundle:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Move files
run: |
sudo mkdir /srv/PVEDD &&
sudo chown $USER:$USER /srv/PVEDD &&
cp $GITHUB_WORKSPACE/PVEDiscordDark.sh /srv/PVEDD/ &&
mkdir /srv/PVEDD/offline &&
cp -r $GITHUB_WORKSPACE/meta /srv/PVEDD/offline &&
mkdir /srv/PVEDD/offline/PVEDiscordDark &&
cp -r $GITHUB_WORKSPACE/PVEDiscordDark/images /srv/PVEDD/offline/PVEDiscordDark/ &&
cp -r $GITHUB_WORKSPACE/PVEDiscordDark/js /srv/PVEDD/offline/PVEDiscordDark/ &&
mkdir /srv/PVEDD/offline/PVEDiscordDark/sass
cp $GITHUB_WORKSPACE/PVEDiscordDark/sass/PVEDiscordDark.css /srv/PVEDD/offline/PVEDiscordDark/sass/
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: PVEDiscordDark
path: /srv/PVEDD/
- name: Install zip
if: ${{ github.event_name == 'release' }}
uses: montudor/action-zip@v0.1.0
- name: Package folder
if: ${{ github.event_name == 'release' }}
run: zip -qq -r PVEDiscordDark.zip PVEDiscordDark.sh offline
working-directory: /srv/PVEDD
- name: Upload to release
if: ${{ github.event_name == 'release' }}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: /srv/PVEDD/PVEDiscordDark.zip
asset_name: PVEDiscordDark.zip
asset_content_type: application/zip
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ Furthermore, you will be able to provide the environment variables `REPO` and `T
`REPO` is in format `Username/Repository` and defaults to `Weilbyte/PVEDiscordDark` (this repository).
`TAG` defaults to `master`, but it is strongly recommended to use the SHA-1 commit hash for security.

## Offline bundle
If desired, the installation utility can be run offline. Upon detecting a folder called `offline` in the current working directory, the script will enter offline mode and use the resources within that folder instead of retrieving them from GitHub.

The `offline` folder must have the following files: `meta/[imagelist, supported]`, `PVEDiscordDark/images/*`, `PVEDiscordDark/js/PVEDiscordDark.js`, `PVEDiscordDark/sass/PVEDiscordDark.css`

You can find a zip containing the installer and offline folder under the artifact section of the GitHub Actions under this repository or as an asset attached to releases.

## Notes
Thanks to [jonasled](https://github.com/jonasled) for helping out with the old version, and thanks to [SmallEngineMechanic](https://github.com/smallenginemechanic) for catching bugs for the rewrite!

Expand Down

0 comments on commit a3b8d7b

Please sign in to comment.