Skip to content

Commit

Permalink
fix: simplify monsterpi install script
Browse files Browse the repository at this point in the history
  • Loading branch information
davidzwa committed Oct 14, 2023
1 parent 93cd05c commit ce9e30e
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 38 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,24 @@ jobs:
run: |
zip ${{ steps.copy.outputs.image }}.zip ${{ steps.copy.outputs.image }}.img
- name: Create release
uses: actions/create-release@v1
id: create_release
with:
draft: ${{ github.ref_name == 'develop' }}
prerelease: ${{ contains(env.SERVER_VERSION, 'rc') || contains(env.SERVER_VERSION, 'unstable') }}
tag_name: ${{ env.RELEASE_TAG }}
release_name: ${{ env.RELEASE_TAG }} Awesome Axolotl 😃
body: "Release notes not added" # ${{ steps.build_changelog.outputs.changelog }}
env:
GITHUB_TOKEN: ${{ github.token }}

- name: Upload server bundle zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist-server-${{ env.SERVER_VERSION }}.zip
asset_name: dist-server-${{ env.SERVER_VERSION }}.zip
asset_content_type: application/zip
48 changes: 19 additions & 29 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,34 +82,24 @@ jobs:
separator: '/'
msg: ${{ github.repository }}

- name: Install GitReleaseManager
uses: gittools/actions/gitreleasemanager/setup@v0.10.2
- name: Create release
uses: actions/create-release@v1
id: create_release
with:
versionSpec: '0.13.x'

- name: Create release with GitReleaseManager
uses: gittools/actions/gitreleasemanager/create@v0.10.2
with:
token: ${{ secrets.GITHUB_TOKEN }}
owner: ${{ steps.repo.outputs._0 }}
repository: ${{ steps.repo.outputs._1 }}
milestone: ${{ steps.gitversion.outputs.majorMinorPatch }}
name: 'Release ${{ steps.gitversion.outputs.majorMinorPatch }}'
assets: |
${{ steps.copy.outputs.image }}.zip
- name: Publish release with GitReleaseManager
uses: gittools/actions/gitreleasemanager/publish@v0.10.2
with:
token: ${{ secrets.GITHUB_TOKEN }}
owner: ${{ steps.repo.outputs._0 }}
repository: ${{ steps.repo.outputs._1 }}
tagName: ${{ steps.gitversion.outputs.majorMinorPatch }}

- name: Close release with GitReleaseManager
uses: gittools/actions/gitreleasemanager/close@v0.10.2
draft: ${{ github.ref_name == 'develop' }}
prerelease: ${{ contains(env.SERVER_VERSION, 'rc') || contains(env.SERVER_VERSION, 'unstable') }}
tag_name: ${{ env.RELEASE_TAG }}
release_name: ${{ env.RELEASE_TAG }} Awesome Axolotl 😃
body: "Release notes not added" # ${{ steps.build_changelog.outputs.changelog }}
env:
GITHUB_TOKEN: ${{ github.token }}

- name: Upload server bundle zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
owner: ${{ steps.repo.outputs._0 }}
repository: ${{ steps.repo.outputs._1 }}
milestone: ${{ steps.gitversion.outputs.majorMinorPatch }}
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist-server-${{ env.SERVER_VERSION }}.zip
asset_name: dist-server-${{ env.SERVER_VERSION }}.zip
asset_content_type: application/zip
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ echo "[3/${ts}] Extracting new dist zip to ${dist_active_path}"

# Step 4) Ensure the required packages are present with yarn (which is already installed, we're just keeping it fresh)
echo "[4/${ts}] Updating the necessary modules of FDM Monster"
yarn install --production --pure-lockfile
yarn install --production --pure-lockfile --network-timeout 1000000000

# Step 5) Run the service
popd
Expand Down
12 changes: 4 additions & 8 deletions src/modules/monsterpi/start_chroot_script
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,15 @@ npm install -g npm
npm install -g yarn

pushd /home/"${BASE_USER}"
# Install FDM Monster
cd /home/"${BASE_USER}"/fdm-monster-daemon/
bash ./update-fdm-monster.sh

# Update the packages (this is really slow on QEMU!)
cd /home/"${BASE_USER}"/fdm-monster/
yarn install --production --frozen-lockfile --network-timeout 1000000000

# Prepare the systemd service
cd /home/"${BASE_USER}"/fdm-monster-daemon
npm i node-linux
npm i

# Install FDM Monster (this is really slow on QEMU!)
cd /home/"${BASE_USER}"/fdm-monster-daemon/
bash ./update-fdm-monster.sh

# Enable the systemd service at boot
systemctl enable fdmmonster

Expand Down

0 comments on commit ce9e30e

Please sign in to comment.