Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish formats #195

Draft
wants to merge 29 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
dd5e0f9
Startet adding a flatpak manifest
MaFeLP Jun 12, 2022
c068571
Removed unneeded old "assets"
MaFeLP Jun 19, 2022
291f056
Added an icon of pokete as SVG
MaFeLP Jun 19, 2022
787abc3
Added flatpak build script
MaFeLP Jun 19, 2022
4ce6fd0
Removed old pokete logo svg.
MaFeLP Jun 19, 2022
144cd8a
Added new pokete logo svg
MaFeLP Jun 19, 2022
68bdea7
Updated changelog
MaFeLP Jun 20, 2022
5b3a6eb
Added metainfo.xml file
MaFeLP Jun 20, 2022
1123ade
Fixed metadata file bug
MaFeLP Jun 20, 2022
8142c33
Further update the appstream file
MaFeLP Jun 22, 2022
49b862f
Made import calls local
MaFeLP Jun 30, 2022
6ac623f
Added pip setup file and pyproject.toml
MaFeLP Jul 1, 2022
1ec9c5b
Added Dockerfile
MaFeLP Jul 21, 2022
e3859ad
Added a docker build and push event.
MaFeLP Jul 21, 2022
880750f
Added documentation to the setup.py
MaFeLP Jul 21, 2022
c166c46
Started adding installation documentation.
MaFeLP Jul 21, 2022
3c20206
Switched all release imports to from release import ...
MaFeLP Aug 5, 2022
acc6866
Merge branch 'master' into publish-formats
MaFeLP Aug 5, 2022
508d89f
Removed unnecessary file.
MaFeLP Aug 5, 2022
ba6c29e
Updated the setup.py to install playsound as well.
MaFeLP Aug 5, 2022
f2bfbc5
Added a debian build script.
MaFeLP Aug 7, 2022
f6d288a
Added implementation for new playsound to the setup process.
MaFeLP Aug 7, 2022
5cd860f
Added automatic builds of the debian package to the release workflow
MaFeLP Aug 7, 2022
004ca9c
Made debbuild executable
lxgr-linux Aug 7, 2022
0b7949e
Added curl as a dependancy
lxgr-linux Aug 7, 2022
524607c
Updated version in release.py
lxgr-linux Aug 7, 2022
c2c2548
Updated the dockerfile to work with the new playsound system
MaFeLP Aug 9, 2022
2db190d
Added a snap package
MaFeLP Aug 9, 2022
84b4a6e
Updated the snap base to core22
MaFeLP Aug 9, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
**/__pycache__/
**/.idea/
/.git/
/playsound/libplaysound*
5 changes: 4 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ max_line_length = 80
max_line_length = off


[*.md]
[*.md,*.yaml,*.yml,*.sh]
indent_size = 2
tab_width = 2

[packages/deb/assets/debian/rules]
indent_style = tab
tab_width = 4
158 changes: 128 additions & 30 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,9 @@ on:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
release:
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

- name: Get tag
Expand All @@ -29,34 +24,17 @@ jobs:
with:
# Optionally strip `v` prefix
strip_v: true

- name: path
run: echo "::set-output name=path::Pokete-${{ steps.tag.outputs.tag }}-x86_64.AppImage"
id: path

# Runs a set of commands using the runners shell
- name: Prepare
run: |
echo ${{ steps.tag.outputs.tag }}
echo ${{ steps.path.outputs.path }}
sudo apt install -y python3-pip python3-setuptools patchelf desktop-file-utils libgdk-pixbuf2.0-dev fakeroot strace fuse
sudo wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -O /usr/local/bin/appimagetool
sudo chmod +x /usr/local/bin/appimagetool
sudo pip3 install git+https://github.com/AppImageCrafters/appimage-builder.git
sed -i '/app_info:/{n;n;n;n;s/\(version\).*/\1: '"${{ steps.tag.outputs.tag }}"'/}' assets/AppImageBuilder.yml

- name: Build Appimage
run: appimage-builder --skip-test --recipe assets/AppImageBuilder.yml


- name: Get Changelog Entry
id: changelog_reader
uses: mindsers/changelog-reader-action@v2
with:
validation_depth: 10
version: ${{ steps.tag.outputs.tag }}
path: ./Changelog.md

- name: release


- name: Create release
uses: actions/create-release@v1
id: create_release
with:
Expand All @@ -67,13 +45,133 @@ jobs:
body: ${{ steps.changelog_reader.outputs.changes }}
env:
GITHUB_TOKEN: ${{ github.token }}

- name: upload linux artifact

debianpkg:
runs-on: ubuntu-latest
needs: "release"

steps:
- uses: actions/checkout@v3

- name: Get tag
id: tag
uses: dawidd6/action-get-tag@v1
with:
# Optionally strip `v` prefix
strip_v: true

- name: Build Debian package
run: tools/debbuild.sh

- name: Get release release url
run: |
url=$(gh api 'https://api.github.com/repos/lxgr-linux/pokete/releases/latest' | jq -r '.upload_url')
echo "Url: ${url}"
echo "::set-output name=url::${url}"
id: url

- name: Get Debian package path
run: |
p=ls build/pokete_${{ steps.tag.outputs.tag }}-1_amd64.deb
echo "Path: ${p}"
echo "::set-output name=path::${p}"
id: path

- name: Upload debian package
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.url.outputs.url }}
asset_path: ${{ steps.path.outputs.path }}
asset_name: pokete_${{ steps.tag.outputs.tag }}-1_amd64.deb
asset_content_type: application/x-deb


appimage:
runs-on: ubuntu-latest
needs: "release"

steps:
- uses: actions/checkout@v3

- name: Get tag
id: tag
uses: dawidd6/action-get-tag@v1
with:
# Optionally strip `v` prefix
strip_v: true

- name: path
run: echo "::set-output name=path::Pokete-${{ steps.tag.outputs.tag }}-x86_64.AppImage"
id: path

- name: Get release url
run: |
url=$(gh api 'https://api.github.com/repos/lxgr-linux/pokete/releases/latest' | jq -r '.upload_url')
echo "Url: ${url}"
echo "::set-output name=url::${url}"
id: url

- name: Prepare
run: |
echo ${{ steps.tag.outputs.tag }}
echo ${{ steps.path.outputs.path }}
sudo apt install -y python3-pip python3-setuptools patchelf desktop-file-utils libgdk-pixbuf2.0-dev fakeroot strace fuse
sudo wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -O /usr/local/bin/appimagetool
sudo chmod +x /usr/local/bin/appimagetool
sudo pip3 install git+https://github.com/AppImageCrafters/appimage-builder.git
sed -i '/app_info:/{n;n;n;n;s/\(version\).*/\1: '"${{ steps.tag.outputs.tag }}"'/}' assets/AppImageBuilder.yml

- name: Build Appimage
run: appimage-builder --skip-test --recipe assets/AppImageBuilder.yml

- name: Upload AppImage
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
upload_url: ${{ steps.url.outputs.url }}
asset_path: ${{ steps.path.outputs.path }}
asset_name: ${{ steps.path.outputs.path }}
asset_content_type: application/appimage

# Build and push the docker images
docker:
runs-on: ubuntu-latest
needs: "release"
permissions:
packages: write
contents: read
steps:
- name: Checkout the code
uses: actions/checkout@v3

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: |
hub.docker.com/${{ github.repository }}
ghcr.io/${{ github.repository }}

- name: Build and push Docker images
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ templates

.idea
scrap_engine.py

# flatpak build directories
.flatpak-builder
build
38 changes: 38 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
FROM ubuntu:22.04 AS compile-image

WORKDIR /build

RUN apt-get update && \
DEBIAN_FRONTEND=non-interactive apt-get install -y \
libasound-dev \
libpulse-dev \
pkg-config \
golang \
curl

COPY playsound /build/playsound/

RUN curl -o scrap_engine.py "https://raw.githubusercontent.com/lxgr-linux/scrap_engine/master/scrap_engine.py" && \
cd playsound && \
go build -ldflags "-s -w" -buildmode=c-shared -buildvcs=false -o ./libplaysound.so && \
rm -v go.mod go.sum main.go README.md

FROM ubuntu:22.04

WORKDIR /app

RUN apt-get update && \
DEBIAN_FRONTEND=non-interactive apt-get install -y \
alsa-base \
pulseaudio \
python3

RUN mkdir -p /root/.local/share/pokete && \
ln -s /root/.local/share/pokete /data

COPY . .
COPY --from=compile-image /build /app

VOLUME ["/data"]

CMD [ "python3", "./pokete.py" ]
Binary file not shown.
Binary file not shown.
Binary file removed assets/Bildschirmfoto_2021-06-04_09-04-44.kra
Binary file not shown.
Binary file removed assets/Bildschirmfoto_2021-06-04_09-04-44.png
Binary file not shown.
Binary file removed assets/banner.png.kra
Binary file not shown.
69 changes: 69 additions & 0 deletions assets/com.github.lxgr_linux.pokete.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
app-id: com.github.lxgr_linux.pokete
runtime: org.freedesktop.Platform
runtime-version: '21.08'
sdk: org.freedesktop.Sdk
command: /app/bin/pokete

finish-args:
# Store save files and logs
- "--filesystem=xdg-cache/pokete:create"
# Trading and update checking
- "--share=network"

modules:
# Dependency of scrap engine; generated with flatpak-pip-generator
- name: python3-setuptools_scm
buildsystem: simple
build-commands:
- pip3 install --verbose --exists-action=i --no-index --find-links="file://${PWD}" --prefix=${FLATPAK_DEST} "setuptools_scm>=6.4.2" --no-build-isolation
sources:
- type: file
url: https://files.pythonhosted.org/packages/97/75/10a9ebee3fd790d20926a90a2547f0bf78f371b2f13aa822c759680ca7b9/tomli-2.0.1-py3-none-any.whl
sha256: 939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc
- type: file
url: https://files.pythonhosted.org/packages/6c/10/a7d0fa5baea8fe7b50f448ab742f26f52b80bfca85ac2be9d35cdd9a3246/pyparsing-3.0.9-py3-none-any.whl
sha256: 5026bae9a10eeaefb61dab2f09052b9f4307d44aee4eda64b309723d8d206bbc
- type: file
url: https://files.pythonhosted.org/packages/05/8e/8de486cbd03baba4deef4142bd643a3e7bbe954a784dc1bb17142572d127/packaging-21.3-py3-none-any.whl
sha256: ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522
- type: file
url: https://files.pythonhosted.org/packages/e3/e5/c28b544051340e63e0d507eb893c9513d3a300e5e9183e2990518acbfe36/setuptools_scm-6.4.2-py3-none-any.whl
sha256: acea13255093849de7ccb11af9e1fb8bde7067783450cee9ef7a93139bddf6d4

# Dependency of pokete; generated with flatpak-pip-generator
- name: python3-scrap_engine
buildsystem: simple
build-commands:
- "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"scrap_engine>=1.2.0\" --no-build-isolation"
sources:
- type: "file"
url: "https://files.pythonhosted.org/packages/3e/d6/b51ae9c311603c76e952a39baabca3c81887e4609f7bf7308c2e19ac8c9f/scrap_engine-1.2.0.tar.gz"
sha256: "767ffdc312b550777771cdc9a350a9f6dca73855259dd1fe7197c8736e38cac1"

# The actual game files
- name: pokete
buildsystem: simple
build-commands:
# Copy Files
- "cp -r . /app"
# Create the desktop entry
- "sed -i 's#Icon=/usr/share/pokete/assets/pokete.png#Icon=com.github.lxgr_linux.pokete#g' assets/pokete.desktop"
- "sed -i 's#Exec=/usr/bin/pokete.py#Exec=/app/bin/pokete#g' assets/pokete.desktop"
- "install -D assets/pokete.desktop /app/share/applications/com.github.lxgr_linux.pokete.desktop"
- "install -D assets/pokete.svg /app/share/icons/hicolor/296x256/apps/com.github.lxgr_linux.pokete.png"
# Set Environment
- "echo 'environment=\"flatpak\"' >> /app/release.py"
# Generate shell wrapper script
- "mkdir -p /app/bin"
- "echo 'cd /app && python3 pokete.py --log' >> /app/bin/pokete"
- "chmod +x /app/bin/pokete"
sources:
- type: archive
url: "https://github.com/lxgr-linux/pokete/archive/refs/tags/0.7.2.tar.gz"
sha256: "7410b2043a53e636bfb8c9ede4c24f933f2bd3f5685ff0b2b3031206d7cbd5f4"

cleanup:
- "/.github"
- "/*.md"
- "/.*"
- "/Pipfile*"
4 changes: 2 additions & 2 deletions assets/pokete.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Version=1.0
Type=Application
Name=Pokete
Comment=A terminal based Pokemon clone, based on the scrap engine.
Exec=/usr/bin/pokete.py
Icon=/usr/share/pokete/assets/pokete.png
Exec=/usr/bin/pokete.py --log
Icon=/usr/share/pokete/assets/pokete.svg
Terminal=true
StartupNotify=false
Categories=Game;
Binary file removed assets/pokete_old.png
Binary file not shown.
Loading