orbiscreen | v0.30.8 | style: enforce rustfmt formatting in aoa and d… #219
Workflow file for this run
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: Publish to Launchpad PPA | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| inputs: | |
| series: | |
| description: 'Ubuntu series (e.g. noble for 24.04, jammy for 22.04)' | |
| required: true | |
| default: 'noble' | |
| type: choice | |
| options: | |
| - noble | |
| - jammy | |
| - oracular | |
| jobs: | |
| build-and-upload-ppa: | |
| name: Build & Upload Source Package to PPA | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Install Debian packaging dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential debhelper devscripts dput dpkg-dev pkg-config \ | |
| libglib2.0-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \ | |
| gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly \ | |
| libevdev-dev libxkbcommon-dev | |
| - name: Verify source build before upload | |
| run: | | |
| cargo build --release --workspace --locked --exclude orbiscreen-gui | |
| cargo test --workspace --locked --exclude orbiscreen-gui | |
| - name: Vendor Cargo dependencies | |
| run: | | |
| cargo vendor vendor/ | |
| mkdir -p .cargo | |
| cat << 'CFG' > .cargo/config.toml | |
| [source.crates-io] | |
| replace-with = "vendored-sources" | |
| [source.vendored-sources] | |
| directory = "vendor" | |
| CFG | |
| - name: Configure GPG key for signing | |
| env: | |
| GPG_KEY: ${{ secrets.PPA_GPG_KEY || secrets.RPM_GPG_KEY }} | |
| run: | | |
| if [ -z "$GPG_KEY" ]; then | |
| echo "::error::Please add PPA_GPG_KEY (or RPM_GPG_KEY) to repository secrets" | |
| exit 1 | |
| fi | |
| echo "$GPG_KEY" | base64 -d 2>/dev/null | gpg --batch --import || echo "$GPG_KEY" | gpg --batch --import | |
| GPG_KEY_ID=$(gpg --list-secret-keys --with-colons | awk -F: '$1=="sec"{print $5; exit}') | |
| if [ -z "$GPG_KEY_ID" ]; then | |
| echo "::error::No secret key found after importing GPG_KEY" | |
| exit 1 | |
| fi | |
| echo "GPG_KEY_ID=$GPG_KEY_ID" >> "$GITHUB_ENV" | |
| - name: Prepare debian/changelog for target series | |
| run: | | |
| SERIES="${{ github.event.inputs.series || 'noble' }}" | |
| VERSION="${GITHUB_REF_NAME#v}" | |
| if [ "$VERSION" = "main" ] || [ -z "$VERSION" ]; then | |
| VERSION="$(grep -m1 '^version' Cargo.toml | sed 's/.*"\(.*\)".*/\1/')" | |
| fi | |
| cat << CHLOG > debian/changelog | |
| orbiscreen (${VERSION}~ubuntu${SERIES}1) ${SERIES}; urgency=medium | |
| * Release ${VERSION} for Ubuntu ${SERIES}. | |
| -- shadow-x78 <107577376+shadow-x78@users.noreply.github.com> $(date -R) | |
| CHLOG | |
| - name: Build Debian Source Package | |
| run: | | |
| debuild --no-lintian -S -sa -d -k"${GPG_KEY_ID}" -p"gpg --batch --pinentry-mode loopback" | |
| - name: Configure dput | |
| run: | | |
| cat << 'EOF' > ~/.dput.cf | |
| [DEFAULT] | |
| passive_ftp = 1 | |
| allow_unsigned_uploads = 1 | |
| [ppa] | |
| fqdn = ppa.launchpad.net | |
| method = ftp | |
| incoming = ~%(ppa)s/ubuntu/ | |
| login = anonymous | |
| passive_ftp = 1 | |
| allow_unsigned_uploads = 1 | |
| [orbiscreen-ppa] | |
| fqdn = ppa.launchpad.net | |
| method = ftp | |
| incoming = ~shadow-x78/ubuntu/ppa/ | |
| login = anonymous | |
| passive_ftp = 1 | |
| allow_unsigned_uploads = 1 | |
| EOF | |
| - name: Upload to Launchpad PPA via dput | |
| run: | | |
| CHANGES_FILE=$(ls ../orbiscreen_*_source.changes | tail -n 1) | |
| echo "Uploading $CHANGES_FILE to Launchpad PPA..." | |
| for attempt in 1 2 3 4; do | |
| echo "Attempt $attempt: uploading to Launchpad PPA..." | |
| if dput -u -P -f orbiscreen-ppa "$CHANGES_FILE" || dput -u -P -f ppa:shadow-x78/ppa "$CHANGES_FILE"; then | |
| echo "Upload successfully completed." | |
| exit 0 | |
| fi | |
| echo "Attempt $attempt failed. Waiting 15s before retry..." | |
| sleep 15 | |
| done | |
| echo "::error::Failed to upload to Launchpad PPA after multiple attempts." | |
| exit 1 | |