Skip to content

Commit

Permalink
Merge pull request #61 from kloptops/main
Browse files Browse the repository at this point in the history
Added new Release targets, updated muOS support.
  • Loading branch information
kloptops authored Feb 25, 2024
2 parents 17047a1 + 252d7df commit f692eee
Show file tree
Hide file tree
Showing 24 changed files with 2,200 additions and 1,580 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/release-alpha.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
# We only run manually
workflow_dispatch:

concurrency:
concurrency:
group: release # only 1 release at a time

jobs:
Expand Down Expand Up @@ -74,7 +74,7 @@ jobs:
id: create-zip
run: |
./do_release.sh "${{steps.version.outputs.release}}" "${{steps.version.outputs.version}}"
- name: Create md5 hashes
id: md5
run: |
Expand All @@ -85,7 +85,7 @@ jobs:
echo "file: $file"
md5sum "$file" | cut -f1 -d' ' > "$file.md5"
done
- name: "Prepare Release"
uses: ncipollo/release-action@v1
with:
Expand All @@ -95,7 +95,7 @@ jobs:
prerelease: false
replacesArtifacts: false
omitNameDuringUpdate: true
body: "Release: ${{steps.version.outputs.release}} (${{steps.version.outputs.version}})"
body: "Release: ${{steps.version.outputs.version}} (${{steps.version.outputs.release}})"
artifacts: "PortMaster.zip, PortMaster.zip.md5, version, version.json, Install*PortMaster.sh"
token: ${{ secrets.GITHUB_TOKEN }}
repo: ${{ steps.env.outputs.RELEASE_REPO }}
Expand Down
120 changes: 120 additions & 0 deletions .github/workflows/release-beta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
name: GUI Release Beta

on:
# We only run manually
workflow_dispatch:

concurrency:
group: release # only 1 release at a time

jobs:
build:
runs-on: ubuntu-20.04

steps:
- name: Clean out files part 1
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- uses: actions/checkout@v4

- name: Clean out files part 2
run: |
rm -rf .git
echo "Free Space"
df -h
- name: env - better defaulting of env vars;
id: env
run: |
RELEASE_REPO="${{ secrets.RELEASE_REPO }}"
if [[ -z "$RELEASE_REPO" ]]; then
RELEASE_REPO="PortMaster-GUI"
fi
echo "RELEASE_REPO=$RELEASE_REPO" >> $GITHUB_OUTPUT
RELEASE_ORG="${{ secrets.RELEASE_ORG }}"
if [[ -z "$RELEASE_ORG" ]]; then
RELEASE_ORG="PortsMaster"
fi
echo "RELEASE_ORG=$RELEASE_ORG" >> $GITHUB_OUTPUT
- uses: actions/setup-python@v4
with:
python-version: '3.x'

- uses: edgarrc/action-7z@v1

- uses: robinraju/release-downloader@v1.8
with:
repository: ${{ github.repository }}
latest: true
fileName: "*.json"

- uses: robinraju/release-downloader@v1.8
with:
repository: ${{ github.repository }}
latest: true
fileName: "Install*PortMaster.sh"

- name: Get release name for artifacts
id: version
run: |
echo "version=$(date -u +'%Y.%m.%d-%H%M')" >> $GITHUB_OUTPUT
echo "release=beta" >> $GITHUB_OUTPUT
- name: Install gettext
run: |
sudo apt-get install -y gettext
- name: Create PortMaster.zip
id: create-zip
run: |
./do_release.sh "${{steps.version.outputs.release}}" "${{steps.version.outputs.version}}"
- name: Create md5 hashes
id: md5
run: |
for file in *.zip; do
if [ ! -f "$file" ]; then
continue
fi
echo "file: $file"
md5sum "$file" | cut -f1 -d' ' > "$file.md5"
done
- name: "Prepare Release"
uses: ncipollo/release-action@v1
with:
tag: "${{steps.version.outputs.version}}"
allowUpdates: true
draft: true
prerelease: false
replacesArtifacts: false
omitNameDuringUpdate: true
body: "Release: ${{steps.version.outputs.version}} (${{steps.version.outputs.release}})"
artifacts: "PortMaster.zip, PortMaster.zip.md5, version, version.json, Install*PortMaster.sh"
token: ${{ secrets.GITHUB_TOKEN }}
repo: ${{ steps.env.outputs.RELEASE_REPO }}
owner: ${{ steps.env.outputs.RELEASE_ORG }}

- name: "Publish Release"
uses: ncipollo/release-action@v1
with:
tag: "${{steps.version.outputs.version}}"
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
allowUpdates: true
draft: false
prerelease: false
token: ${{ secrets.GITHUB_TOKEN }}
repo: ${{ steps.env.outputs.RELEASE_REPO}}
owner: ${{ steps.env.outputs.RELEASE_ORG}}

- name: Release Info
id: info
run: |
echo "Published release: ${{steps.version.outputs.version}} to: https://github.com/${{ steps.env.outputs.RELEASE_ORG}}/${{ steps.env.outputs.RELEASE_REPO}}"
120 changes: 120 additions & 0 deletions .github/workflows/release-stable.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
name: GUI Release Stable

on:
# We only run manually
workflow_dispatch:

concurrency:
group: release # only 1 release at a time

jobs:
build:
runs-on: ubuntu-20.04

steps:
- name: Clean out files part 1
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- uses: actions/checkout@v4

- name: Clean out files part 2
run: |
rm -rf .git
echo "Free Space"
df -h
- name: env - better defaulting of env vars;
id: env
run: |
RELEASE_REPO="${{ secrets.RELEASE_REPO }}"
if [[ -z "$RELEASE_REPO" ]]; then
RELEASE_REPO="PortMaster-GUI"
fi
echo "RELEASE_REPO=$RELEASE_REPO" >> $GITHUB_OUTPUT
RELEASE_ORG="${{ secrets.RELEASE_ORG }}"
if [[ -z "$RELEASE_ORG" ]]; then
RELEASE_ORG="PortsMaster"
fi
echo "RELEASE_ORG=$RELEASE_ORG" >> $GITHUB_OUTPUT
- uses: actions/setup-python@v4
with:
python-version: '3.x'

- uses: edgarrc/action-7z@v1

- uses: robinraju/release-downloader@v1.8
with:
repository: ${{ github.repository }}
latest: true
fileName: "*.json"

- uses: robinraju/release-downloader@v1.8
with:
repository: ${{ github.repository }}
latest: true
fileName: "Install*PortMaster.sh"

- name: Get release name for artifacts
id: version
run: |
echo "version=$(date -u +'%Y.%m.%d-%H%M')" >> $GITHUB_OUTPUT
echo "release=stable" >> $GITHUB_OUTPUT
- name: Install gettext
run: |
sudo apt-get install -y gettext
- name: Create PortMaster.zip
id: create-zip
run: |
./do_release.sh "${{steps.version.outputs.release}}" "${{steps.version.outputs.version}}"
- name: Create md5 hashes
id: md5
run: |
for file in *.zip; do
if [ ! -f "$file" ]; then
continue
fi
echo "file: $file"
md5sum "$file" | cut -f1 -d' ' > "$file.md5"
done
- name: "Prepare Release"
uses: ncipollo/release-action@v1
with:
tag: "${{steps.version.outputs.version}}"
allowUpdates: true
draft: true
prerelease: false
replacesArtifacts: false
omitNameDuringUpdate: true
body: "Release: ${{steps.version.outputs.version}} (${{steps.version.outputs.release}})"
artifacts: "PortMaster.zip, PortMaster.zip.md5, version, version.json, Install*PortMaster.sh"
token: ${{ secrets.GITHUB_TOKEN }}
repo: ${{ steps.env.outputs.RELEASE_REPO }}
owner: ${{ steps.env.outputs.RELEASE_ORG }}

- name: "Publish Release"
uses: ncipollo/release-action@v1
with:
tag: "${{steps.version.outputs.version}}"
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
allowUpdates: true
draft: false
prerelease: false
token: ${{ secrets.GITHUB_TOKEN }}
repo: ${{ steps.env.outputs.RELEASE_REPO}}
owner: ${{ steps.env.outputs.RELEASE_ORG}}

- name: Release Info
id: info
run: |
echo "Published release: ${{steps.version.outputs.version}} to: https://github.com/${{ steps.env.outputs.RELEASE_ORG}}/${{ steps.env.outputs.RELEASE_REPO}}"
2 changes: 1 addition & 1 deletion PortMaster/muos/PortMaster.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

controlfolder="/mnt/mmc/ports/PortMaster"
controlfolder="/mnt/mmc/MUOS/PortMaster"

if [ ! -z "$(df | grep '/mnt/sdcard')" ]; then
directory="/mnt/sdcard"
Expand Down
2 changes: 1 addition & 1 deletion PortMaster/muos/control.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

controlfolder="/mnt/mmc/ports/PortMaster"
controlfolder="/mnt/mmc/MUOS/PortMaster"

if [ ! -z "$(df | grep '/mnt/sdcard')" ]; then
directory="/mnt/sdcard"
Expand Down
4 changes: 4 additions & 0 deletions PortMaster/pugwash
Original file line number Diff line number Diff line change
Expand Up @@ -1783,6 +1783,10 @@ def portmaster_check_update(pm, config, temp_dir):
allow_cancel=False,
md5_source=release_info[release_channel]['md5'])

if change_channel:
pm.hm.cfg_data['change_channel'] = False
pm.hm.save_config()

reboot_file = (harbourmaster.HM_TOOLS_DIR / "PortMaster" / ".pugwash-reboot")
if not reboot_file.is_file():
reboot_file.touch(0o644)
Expand Down
2 changes: 1 addition & 1 deletion PortMaster/pylibs/harbourmaster/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
HM_TESTING=True

elif Path("/opt/muos").is_dir():
HM_DEFAULT_TOOLS_DIR = Path("/mnt/mmc/ports")
HM_DEFAULT_TOOLS_DIR = Path("/mnt/mmc/MUOS")
HM_DEFAULT_PORTS_DIR = Path("/mnt/mmc/ports")
HM_DEFAULT_SCRIPTS_DIR = Path("/mnt/mmc/ROMS/PORTS")

Expand Down
5 changes: 5 additions & 0 deletions PortMaster/pylibs/harbourmaster/harbour.py
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,11 @@ def port_info_attrs(self, port_info):
if rtr:
add_list_unique(attrs, 'rtr')

arch=port_info.get('attr', {}).get('arch', None)
if isinstance(arch, list):
for arc in arch:
add_list_unique(attrs, arc)

exp = port_info.get('attr', {}).get('exp', False)
if exp:
add_list_unique(attrs, 'exp')
Expand Down
23 changes: 18 additions & 5 deletions PortMaster/pylibs/harbourmaster/platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,17 +284,30 @@ def portmaster_install(self):
"""
Move files into place.
"""
Path("/roms/ports/PortMaster").mkdir(exist_ok=True)

MU_DIR = self.hm.tools_dir / "PortMaster" / "muos"
PM_DIR = self.hm.tools_dir / "PortMaster"

# ACTIVATE THE CONTROL
shutil.copy(MU_DIR / "control.txt", self.hm.tools_dir / "PortMaster" / "control.txt")
shutil.copy(MU_DIR / "control.txt", "/roms/ports/PortMaster/control.txt")
logger.debug(f'Copy {MU_DIR / "control.txt"} -> {PM_DIR / "control.txt"}')
shutil.copy(MU_DIR / "control.txt", PM_DIR / "control.txt")

CONTROL_HACK = Path("/roms/ports/PortMaster/control.txt")
if not CONTROL_HACK.parent.is_dir():
CONTROL_HACK.parent.mkdir(parents=True)

logger.debug(f'Copy {MU_DIR / "control.txt"} -> {CONTROL_HACK}')
shutil.copy(MU_DIR / "control.txt", CONTROL_HACK)

# PEBKAC
shutil.copy(MU_DIR / "PortMaster.txt", "/mnt/mmc/ROMS/PORTS/PortMaster.sh")
shutil.copy(MU_DIR / "control.txt", "/roms/ports/PortMaster/control.txt")
logger.debug(f'Move {MU_DIR / "PortMaster.txt"} -> {PM_DIR / "PortMaster.sh"}')
shutil.copy(MU_DIR / "PortMaster.txt", PM_DIR / "PortMaster.sh")

TASK_SET = Path(self.hm.tools_dir / "PortMaster" / "tasksetter")
if TASK_SET.is_file():
TASK_SET.unlink()

TASK_SET.touch()


HM_PLATFORMS = {
Expand Down
Loading

0 comments on commit f692eee

Please sign in to comment.