[tmp] Build AppImage #492
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: AppImage | |
| on: | |
| push: | |
| branches: '*' | |
| tags: 'v*' | |
| workflow_dispatch: | |
| jobs: | |
| Manylinux-Appimage: | |
| strategy: | |
| matrix: | |
| # https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/ | |
| # about-github-hosted-runners | |
| # https://github.blog/changelog/ | |
| # 2025-01-16-linux-arm64-hosted-runners-now-available-for-free-in-public-repositories-public-preview/ | |
| os: ['ubuntu-latest'] | |
| arch: ['x86_64'] | |
| variant: ['slim', 'full'] | |
| include: | |
| - os: 'ubuntu-24.04-arm' | |
| arch: 'aarch64' | |
| variant: 'slim' | |
| - os: 'ubuntu-24.04-arm' | |
| arch: 'aarch64' | |
| variant: 'full' | |
| runs-on: ${{ matrix.os }} | |
| container: quay.io/pypa/manylinux_2_28_${{ matrix.arch }} | |
| env: | |
| APP_PYTHON_VERSION: "3.12" | |
| APPIMAGE_VARIANT: ${{ matrix.variant }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build AppImage | |
| working-directory: AppImage | |
| run: bash build-ratarmount-appimage.sh | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: ratarmount-${{ matrix.variant }}-${{ matrix.arch }}.AppImage | |
| path: "AppImage/ratarmount*-${{ matrix.arch }}.AppImage" | |
| AppImage-Tests: | |
| runs-on: ${{ matrix.os }} | |
| needs: [Manylinux-Appimage] | |
| strategy: | |
| matrix: | |
| os: ['ubuntu-latest'] | |
| arch: ['x86_64'] | |
| parallelization: [0, 1, 2] | |
| include: | |
| - os: 'ubuntu-24.04-arm' | |
| arch: 'aarch64' | |
| parallelization: 1 | |
| - os: 'ubuntu-24.04-arm' | |
| arch: 'aarch64' | |
| parallelization: 2 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| #with: | |
| # # We need one tag for testing the git mount. | |
| # # This is BROKEN! God damn it. Is anything working at all... | |
| # # https://github.com/actions/checkout/issues/1781 | |
| # # https://github.com/actions/checkout/issues/1467 | |
| # #fetch-tags: true | |
| - name: Fetch tag for tests | |
| run: git fetch origin refs/tags/v0.15.2:refs/tags/v0.15.2 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: ratarmount-full-${{ matrix.arch }}.AppImage | |
| - name: Install AppImage | |
| run: | | |
| chmod u+x ratarmount*.AppImage | |
| mv ratarmount*.AppImage /usr/local/bin/ratarmount | |
| echo "/usr/local/bin" >> $GITHUB_PATH | |
| - name: Install Dependencies | |
| run: | | |
| # These are required for creating test files on the fly not for ratarmount! | |
| sudo apt-get -y update | |
| sudo apt-get -y install bzip2 pixz zstd unar fuse | |
| - name: Install pip Test Dependencies | |
| run: | | |
| python3 -m pip install -r tests/requirements-tests.txt | |
| # Explicitly install pygit2 even on Python 3.13+ because we have set up libgit2 manually. | |
| python3 -m pip install pygit2 | |
| python3 -c 'import pygit2' | |
| - name: Test Simple Startup | |
| run: | | |
| ratarmount --help | |
| ratarmount --version | |
| - name: Test Simple Mount | |
| run: | | |
| ratarmount tests/single-file.tar mimi | |
| ls -la mimi | |
| sleep 1s | |
| ratarmount -u mimi | |
| - name: Install pip Test Dependencies | |
| run: | | |
| python3 -m pip install -r tests/requirements-tests.txt | |
| # Explicitly install pygit2 even on Python 3.13+ because we have set up libgit2 manually. | |
| python3 -m pip install pygit2 | |
| python3 -c 'import pygit2' | |
| sudo bash tests/install-smbd.sh | |
| - name: Regression Tests | |
| run: | | |
| # Starting up ratarmount for each very short test is quite slow, especially on the CI machine (3-5s). | |
| # On my local machine, it's around 1s, which is not good, but also not bad. | |
| # The AppImage extraction script is already tested in the simple tests above, so it should be fine | |
| # to extract it once and then test the AppRun script, which still modifies the LD_LIBRARY_PATH and | |
| # still uses the bundled libraries, i.e., it still is a good integrity test for the AppImage. | |
| time /usr/local/bin/ratarmount --appimage-extract | |
| export RATARMOUNT_CMD=$PWD/squashfs-root/AppRun | |
| export PARALLELIZATIONS=${{ matrix.parallelization }} | |
| bash tests/runtests.sh | |
| AppImage-Nightly-Release: | |
| runs-on: ubuntu-latest | |
| needs: [AppImage-Tests] | |
| if: github.ref_name == 'master' | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| pattern: ratarmount-*.AppImage | |
| - name: Strip -full suffix | |
| run: | | |
| for file in $( find . -maxdepth 2 -type f -name 'ratarmount-*full*.AppImage' ); do | |
| mv -- "$file" "$( printf %s "$file" | sed -E 's|-full([^/]*)$|\1|' )" | |
| done | |
| - uses: ncipollo/release-action@v1 | |
| with: | |
| artifacts: "ratarmount*.AppImage/*.AppImage" | |
| tag: "nightly" | |
| commit: "master" | |
| name: "Nightly Release" | |
| allowUpdates: true | |
| removeArtifacts: true | |
| replacesArtifacts: true | |
| updateOnlyUnreleased: true | |
| prerelease: true | |
| makeLatest: false | |
| body: | | |
| This is the newest as of yet unreleased but tested state. | |
| Try this if you have trouble with other versions or you want cutting edge features. | |
| AppImage-Release: | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| runs-on: ubuntu-latest | |
| needs: [AppImage-Tests] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| pattern: ratarmount-*.AppImage | |
| - name: Strip -full suffix | |
| run: | | |
| for file in $( find . -maxdepth 2 -type f -name 'ratarmount-*full*.AppImage' ); do | |
| mv -- "$file" "$( printf %s "$file" | sed -E 's|-full([^/]*)$|\1|' )" | |
| done | |
| # For some dumb reason, Github creates a dummy tag with the commit message as contents?! | |
| # Therefore, delete that and fetch the actual tag -.- | |
| - name: Fetch tags | |
| run: | | |
| git tag -n99 -l # Print wrong auto-generated tag. | |
| git tag -d ${{ github.ref_name }} || true | |
| git fetch origin ${{ github.ref }}:${{ github.ref }} | |
| - name: Prepare Message | |
| run: | | |
| # The tag format should follow: https://github.com/mxmlnkn/ratarmount/releases/tag/v1.0.0 | |
| # but with leading # removed (because the normal git tag tool would remove those as comments) | |
| git tag -l --format='%(contents)' ${{ github.ref_name }} | | |
| sed -E 's|^(ratarmount(core)?)|#\1|; s|^([A-Z][A-Za-z]*)|## \1|' > release.md | |
| cat .github/workflows/release-template.md >> release.md | |
| - uses: ncipollo/release-action@v1 | |
| with: | |
| artifacts: "ratarmount*.AppImage/*.AppImage" | |
| tag: ${{ github.ref_name }} | |
| name: "Ratarmount ${{ github.ref_name }}" | |
| bodyFile: release.md | |
| allowUpdates: true | |
| removeArtifacts: true | |
| replacesArtifacts: true | |
| updateOnlyUnreleased: true | |
| prerelease: true | |
| makeLatest: false |