1- # This workflows will upload a Python Package using Twine when a release is created
2- # For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3-
4- name : Continuous Builds
1+ name : Run tests
52
63on :
7- push :
8- branches :
9- - ' **'
10- tags :
11- - ' !**'
4+ workflow_call :
5+ env :
6+ APPIMAGE_BUILDER_REMOTE_REPO_OWNER : ${{ github.repository_owner }}
127
138jobs :
149 pytest-ubuntu-container :
@@ -18,12 +13,12 @@ jobs:
1813 steps :
1914 - name : Install dependencies
2015 run : |
21- apt-get -y update
16+ apt-get -y update
2217 apt-get install -y fakeroot python3-pip python3-venv lsb-release binutils patchelf git
2318 - name : Checkout
2419 uses : actions/checkout@v4
2520 with :
26- fetch-depth : 0'
21+ fetch-depth : 0
2722 - name : Set up a virtualenv
2823 run : |
2924 python3 -m venv .venv
@@ -34,123 +29,107 @@ jobs:
3429 pip install -e .[dev]
3530 pytest tests
3631
37- pytest-ubuntu-runner :
38- name : Run tests on Ubuntu 24.04 with python 3.13.
32+ pytest-archlinux :
33+ name : Run tests on ArchLinux (Docker)
3934 runs-on : ubuntu-24.04
35+ container : archlinux
4036 steps :
4137 - name : Install dependencies
42- run : |
43- sudo apt-get -y update
44- sudo apt-get install -y fakeroot lsb-release binutils patchelf git
38+ run : pacman -Syu --noconfirm python-pip binutils patchelf fakeroot lsb-release strace patchelf git
4539 - name : Checkout
4640 uses : actions/checkout@v4
4741 with :
4842 fetch-depth : 0
49- - name : Clear Python cache
43+ - name : Set up a virtualenv
5044 run : |
51- sudo rm -rf /__t/Python
52- - name : Install python
53- uses : actions/setup-python@v5
54- with :
55- python-version : ' 3.13'
56- cache : ' pip'
45+ python3 -m venv .venv
5746 - name : Install appimage-builder and run tests
5847 run : |
48+ . .venv/bin/activate
5949 pip install pytest
6050 pip install -e .[dev]
61- python3 -m pytest tests
51+ pytest tests
6252
63- pytest-archlinux :
64- name : Run tests on ArchLinux (Docker)
53+ pytest-ubuntu-runner :
54+ name : Run tests on Ubuntu 24.04 with python 3.13.
6555 runs-on : ubuntu-24.04
66- container : archlinux
6756 steps :
6857 - name : Install dependencies
69- run : pacman -Syu --noconfirm python-pip binutils patchelf fakeroot lsb-release strace patchelf git
58+ run : |
59+ sudo apt-get -y update
60+ sudo apt-get install -y fakeroot lsb-release binutils patchelf git
7061 - name : Checkout
7162 uses : actions/checkout@v4
7263 with :
7364 fetch-depth : 0
74- - name : Set up a virtualenv
65+ - name : Clear Python cache
7566 run : |
76- python3 -m venv .venv
67+ sudo rm -rf /__t/Python
68+ - name : Install python
69+ uses : actions/setup-python@v5
70+ with :
71+ python-version : ' 3.13'
72+ cache : ' pip'
7773 - name : Install appimage-builder and run tests
7874 run : |
79- . .venv/bin/activate
8075 pip install pytest
8176 pip install -e .[dev]
82- pytest tests
77+ python3 -m pytest tests
8378
84- build :
79+ build-pack-bash :
8580 runs-on : ubuntu-24.04
8681 needs : [ pytest-ubuntu-container, pytest-ubuntu-runner, pytest-archlinux ]
8782 steps :
8883 - name : Install dependencies
8984 run : |
9085 sudo apt-get update
91- sudo apt-get install -y patchelf desktop-file-utils libgdk-pixbuf2.0-dev fakeroot strace git lsb-release
86+ sudo apt-get install -y patchelf desktop-file-utils libgdk-pixbuf2.0-dev fakeroot strace git lsb-release python3-build python3-setuptools adwaita-icon-theme
9287 sudo wget https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage -O /usr/local/bin/appimagetool
9388 sudo chmod +x /usr/local/bin/appimagetool
9489 - name : Checkout
9590 uses : actions/checkout@v4
9691 with :
9792 fetch-depth : 0
93+ - name : Build Python Wheel
94+ run : |
95+ cd ${{ github.workspace }}
96+ python3 -m build
9897 - name : Install appimage-builder
9998 run : |
100- sudo pip install setuptools twine
101- pip install --ignore-installed .
99+ pip install --ignore-installed --user --break-system-packages .
102100 - name : Build AppImage
103101 run : |
104- cd recipes/appimage-builder
105- export APPIMAGE_BUILDER_VERSION=$(appimage-builder --version | head -1 | cut -f 2 -d" ")
102+ cd ${{ github.workspace }}/recipes/appimage-builder
103+ export APPIMAGE_BUILDER_VERSION=$(appimage-builder --version | head -1 | cut -f 2 -d" ")
104+ echo "APPIMAGE_BUILDER_VERSION=${APPIMAGE_BUILDER_VERSION}" >> $GITHUB_ENV
106105 appimage-builder --skip-test
107- - name : Upload Artifacts
108- uses : actions/upload-artifact@v4
109- with :
110- name : appimage-builder
111- path : ' recipes/appimage-builder/appimage-builder*.AppImage*'
112- test-pack-bash :
113- runs-on : ubuntu-24.04
114- needs : build
115- steps :
116- - name : Checkout
117- uses : actions/checkout@v4
118- with :
119- fetch-depth : 0
120- - name : Download AppImage from build job
121- uses : actions/download-artifact@v4
122- with :
123- name : appimage-builder
124- - name : Install dependencies
125- run : |
126- sudo apt install -y adwaita-icon-theme
127106 - name : Pack bash
128107 run : |
129108 # build bash
130109 BUILDER_PATH=$(find $PWD -name appimage-builder-*.AppImage)
131110 chmod +x "$BUILDER_PATH"
132- cd recipes/bash/
111+ cd ${{ github.workspace }}/ recipes/bash/
133112 "$BUILDER_PATH" --skip-test
134113 - name : Test bash
135114 run : |
136- recipes/bash/*.AppImage --appimage-extract-and-run -c "echo Hello World"
137- - name : Upload Artifacts
115+ cd ${{ github.workspace }}/recipes/bash/
116+ ./bash*.AppImage --appimage-extract-and-run -c "echo Hello World"
117+ - name : Upload AppImageBuilder AppImage
138118 uses : actions/upload-artifact@v4
139119 with :
140- name : bash
141- path : ' recipes/bash/*.AppImage*'
142- publish :
143- runs-on : ubuntu-24.04
144- needs : test-pack-bash
145- if : github.ref == 'refs/heads/main'
146- steps :
147- - name : Download AppImage from build job
148- uses : actions/download-artifact@v4
120+ name : appimage-builder-${{ env.APPIMAGE_BUILDER_VERSION }}.AppImage
121+ path : ' ${{ github.workspace }}/recipes/appimage-builder/*.AppImage*'
122+ retention-days : 7
123+ - name : Upload AppImageBuilder Python dist
124+ uses : actions/upload-artifact@v4
149125 with :
150- name : appimage-builder
151- - uses : " marvinpinto/action-automatic-releases@latest"
126+ name : appimage-builder-${{ env.APPIMAGE_BUILDER_VERSION }}-pydist
127+ path : ' ${{ github.workspace }}/dist/*'
128+ retention-days : 7
129+ - name : Upload Bash AppImage
130+ uses : actions/upload-artifact@v4
152131 with :
153- repo_token : " ${{ secrets.GITHUB_TOKEN }} "
154- prerelease : true
155- automatic_release_tag : Continuous
156- files : ' appimage-builder*.AppImage* '
132+ name : bash.AppImage
133+ path : ' ${{ github.workspace }}/recipes/bash/*.AppImage* '
134+ retention-days : 7
135+
0 commit comments