# SPDX-License-Identifier: MIT # Release binaries for Linux x86_64 and arm64: Debian package, AppImage and a tarball of the # command-line tool. On a vX.Y.Z tag they are attached to the GitHub release (created here if # tools/release.sh has not created it yet); a manual run keeps them as workflow artifacts. name: Release on: push: tags: ["v*"] workflow_dispatch: permissions: contents: write jobs: linux: name: Linux ${{ matrix.arch }} strategy: fail-fast: false matrix: include: - arch: x86_64 runner: ubuntu-24.04 - arch: arm64 runner: ubuntu-24.04-arm runs-on: ${{ matrix.runner }} steps: - uses: actions/checkout@v5 with: fetch-depth: 0 # tags are needed for the version description - name: Dependencies run: | sudo apt-get update sudo apt-get install -y --no-install-recommends \ build-essential cmake ninja-build pkg-config gettext file desktop-file-utils \ libcurl4-openssl-dev libarchive-dev nlohmann-json3-dev doctest-dev \ libglib2.0-dev libgtkmm-4.0-dev librsvg2-common - name: Build and test run: | cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr \ -DOPENPU_WERROR=ON -DOPENPU_UI_GTK=ON cmake --build build ctest --test-dir build --output-on-failure - name: Debian package run: | cd build && cpack -G DEB dpkg-deb -I openpu_*.deb - name: Command-line tool run: | version=$(build/src/cli/openpu-cli --version | awk '{print $2}') mkdir -p "dist/openpu-cli-$version-linux-${{ matrix.arch }}" cp build/src/cli/openpu-cli LICENSE README.md "dist/openpu-cli-$version-linux-${{ matrix.arch }}/" strip "dist/openpu-cli-$version-linux-${{ matrix.arch }}/openpu-cli" tar -C dist -czf "openpu-cli-$version-linux-${{ matrix.arch }}.tar.gz" "openpu-cli-$version-linux-${{ matrix.arch }}" - name: AppImage run: tools/appimage.sh "$PWD/build-appimage" - name: Collect run: | mkdir -p out mv build/openpu_*.deb openpu-cli-*.tar.gz OpenPU-*.AppImage out/ (cd out && sha256sum * > SHA256SUMS-linux-${{ matrix.arch }}.txt && ls -l) - uses: actions/upload-artifact@v4 with: name: openpu-linux-${{ matrix.arch }} path: out/* - name: Attach to the release if: startsWith(github.ref, 'refs/tags/v') env: GH_TOKEN: ${{ github.token }} TAG: ${{ github.ref_name }} run: | gh release view "$TAG" >/dev/null 2>&1 || gh release create "$TAG" --verify-tag --title "OpenPU ${TAG#v}" --notes-from-tag || gh release view "$TAG" >/dev/null # the other architecture may have created it meanwhile gh release upload "$TAG" out/* --clobber