From 2f599715255811e637571c67e0ff75e7e526c6d9 Mon Sep 17 00:00:00 2001 From: Josh Andrews Date: Wed, 31 Dec 2025 16:32:57 +0000 Subject: [PATCH 01/12] Try fix --- .github/workflows/publish.yml | 40 +++++++++++++++++++++++++++++------ Cargo.lock | 2 +- Cargo.toml | 2 +- 3 files changed, 35 insertions(+), 9 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8d29606..05f216c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -2,6 +2,7 @@ on: push: branches: - main + - release/* paths: - 'Cargo.toml' @@ -85,11 +86,27 @@ jobs: - name: 'Build' run: cargo build --release --all-features + version: + name: Get Version + needs: build_linux + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Get version from Cargo.toml + id: version + run: | + VERSION=$(grep '^version = ' Cargo.toml | head -1 | sed 's/.*"\(.*\)".*/\1/' | sed 's/-.*//') + echo "version=$VERSION" >> $GITHUB_OUTPUT + echo "Version detected: $VERSION" + echo "Release suffix detected: $RELEASE_SUFFIX" + echo "Full version detected: $FULL_VERSION" + add_version_tag: name: Add Version Tag needs: - check_context_tokens - build_linux + - version runs-on: ubuntu-latest timeout-minutes: 10 @@ -104,16 +121,22 @@ jobs: - name: Create Git Tag run: | - git config --global user.name " github-actions[bot]" + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + + TAG="v${{ steps.version.outputs.version }}" + # Check if tag already exists - if git rev-parse "v${{ steps.version.outputs.version }}" >/dev/null 2>&1; then - echo "Tag v${{ steps.version.outputs.version }} already exists, skipping tag creation" - exit 0 + if git rev-parse "$TAG" >/dev/null 2>&1; then + echo "Tag $TAG already exists, moving it to the latest commit" + # Delete the tag locally and remotely + git tag -d "$TAG" + git push origin ":refs/tags/$TAG" || true fi - git config --global user.email "github-actions[bot]@users.noreply.github.com" - git tag "v${{ steps.version.outputs.version }}" - git push origin "v${{ steps.version.outputs.version }}" + # Create and push the new tag + git tag "$TAG" + git push origin "$TAG" crates_io_publish: name: Publish (crates.io) @@ -121,6 +144,7 @@ jobs: - check_context_tokens - audit - build_linux + - version runs-on: ubuntu-latest timeout-minutes: 10 @@ -158,6 +182,8 @@ jobs: needs: - audit - build_linux + - add_version_tag + - version runs-on: ubuntu-latest timeout-minutes: 15 diff --git a/Cargo.lock b/Cargo.lock index b696f19..0f89af9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -255,7 +255,7 @@ dependencies = [ [[package]] name = "hyprsession" -version = "0.2.0-4" +version = "0.2.0-5" dependencies = [ "clap", "hyprland", diff --git a/Cargo.toml b/Cargo.toml index 5f7cc50..e967afd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hyprsession" -version = "0.2.0-4" +version = "0.2.0-5" edition = "2021" authors = [ "Josh Andrews" ] license = "GPL-3.0" From a0c198b4777a6c7c5f250bf5d669775689772b18 Mon Sep 17 00:00:00 2001 From: Josh Andrews Date: Wed, 31 Dec 2025 16:40:36 +0000 Subject: [PATCH 02/12] Try again --- .github/workflows/publish.yml | 3 +-- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 05f216c..2260da6 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,7 +1,6 @@ on: push: branches: - - main - release/* paths: - 'Cargo.toml' @@ -131,7 +130,7 @@ jobs: echo "Tag $TAG already exists, moving it to the latest commit" # Delete the tag locally and remotely git tag -d "$TAG" - git push origin ":refs/tags/$TAG" || true + git push --force origin ":refs/tags/$TAG" || true fi # Create and push the new tag diff --git a/Cargo.toml b/Cargo.toml index e967afd..6426842 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,4 +25,4 @@ path = "src/main.rs" [lib] name = "hyprsession" -path = "src/lib.rs" +path = "src/lib.rs" From 4214e41ee5e67a8224f9dc83d9ee84593a412891 Mon Sep 17 00:00:00 2001 From: Josh Andrews Date: Wed, 31 Dec 2025 16:54:34 +0000 Subject: [PATCH 03/12] Again --- .github/workflows/publish.yml | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 2260da6..53a8ff0 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -4,6 +4,7 @@ on: - release/* paths: - 'Cargo.toml' + - '.github/workflows/publish.yml' name: Publish jobs: @@ -86,26 +87,10 @@ jobs: run: cargo build --release --all-features version: - name: Get Version - needs: build_linux - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Get version from Cargo.toml - id: version - run: | - VERSION=$(grep '^version = ' Cargo.toml | head -1 | sed 's/.*"\(.*\)".*/\1/' | sed 's/-.*//') - echo "version=$VERSION" >> $GITHUB_OUTPUT - echo "Version detected: $VERSION" - echo "Release suffix detected: $RELEASE_SUFFIX" - echo "Full version detected: $FULL_VERSION" - - add_version_tag: name: Add Version Tag needs: - check_context_tokens - build_linux - - version runs-on: ubuntu-latest timeout-minutes: 10 @@ -116,7 +101,10 @@ jobs: run: | VERSION=$(grep '^version = ' Cargo.toml | head -1 | sed 's/.*"\(.*\)".*/\1/' | sed 's/-.*//') echo "version=$VERSION" >> $GITHUB_OUTPUT + echo "release=$RELEASE_SUFFIX" >> $GITHUB_OUTPUT echo "Version detected: $VERSION" + echo "Release suffix detected: $RELEASE_SUFFIX" + echo "Full version detected: $FULL_VERSION" - name: Create Git Tag run: | @@ -134,6 +122,7 @@ jobs: fi # Create and push the new tag + echo "Creating and pushing tag $TAG" git tag "$TAG" git push origin "$TAG" @@ -181,7 +170,6 @@ jobs: needs: - audit - build_linux - - add_version_tag - version runs-on: ubuntu-latest From 249da1c6978e4c462423b058b09ebd6044852999 Mon Sep 17 00:00:00 2001 From: Josh Andrews Date: Wed, 31 Dec 2025 17:02:39 +0000 Subject: [PATCH 04/12] Again --- .github/workflows/publish.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 53a8ff0..612415b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -91,6 +91,7 @@ jobs: needs: - check_context_tokens - build_linux + - audit runs-on: ubuntu-latest timeout-minutes: 10 @@ -113,15 +114,23 @@ jobs: TAG="v${{ steps.version.outputs.version }}" - # Check if tag already exists + # Fetch all tags from remote to ensure we have the latest + git fetch --tags --force + + # Check if tag already exists (locally or remotely) if git rev-parse "$TAG" >/dev/null 2>&1; then echo "Tag $TAG already exists, moving it to the latest commit" - # Delete the tag locally and remotely + # Delete the tag locally git tag -d "$TAG" - git push --force origin ":refs/tags/$TAG" || true + # Delete the tag remotely (force push to delete) + git push origin ":refs/tags/$TAG" || true + else + echo "Tag $TAG does not exist yet, creating new tag" fi # Create and push the new tag + git tag "$TAG" + git push origin "$TAG" echo "Creating and pushing tag $TAG" git tag "$TAG" git push origin "$TAG" From 4716d82530e8cf6a9ea97a5edda3c4bbefada3e7 Mon Sep 17 00:00:00 2001 From: Josh Andrews Date: Wed, 31 Dec 2025 17:31:52 +0000 Subject: [PATCH 05/12] One more time --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 612415b..a075ed5 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -123,7 +123,7 @@ jobs: # Delete the tag locally git tag -d "$TAG" # Delete the tag remotely (force push to delete) - git push origin ":refs/tags/$TAG" || true + git push --force origin ":refs/tags/$TAG" || true else echo "Tag $TAG does not exist yet, creating new tag" fi From 3dabe09d1f1d12b4816b439d1417a34d3bf99c44 Mon Sep 17 00:00:00 2001 From: Josh Andrews Date: Wed, 31 Dec 2025 17:36:09 +0000 Subject: [PATCH 06/12] One more? --- .github/workflows/publish.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a075ed5..35bf11c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -131,9 +131,6 @@ jobs: # Create and push the new tag git tag "$TAG" git push origin "$TAG" - echo "Creating and pushing tag $TAG" - git tag "$TAG" - git push origin "$TAG" crates_io_publish: name: Publish (crates.io) From 2fbe3d474d2b13bc6d0f1797e1646dd3946c1dd0 Mon Sep 17 00:00:00 2001 From: Josh Andrews Date: Wed, 31 Dec 2025 18:23:40 +0000 Subject: [PATCH 07/12] Fix variables in PKGBUILD and add publish verification --- .github/workflows/publish.yml | 98 +++++++++++++++++++++++++++++++---- 1 file changed, 88 insertions(+), 10 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 35bf11c..575aa5e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -57,9 +57,9 @@ jobs: # Optional variables (will use defaults if not set) echo "📋 Checking optional variables..." - echo "CRATES_IO_INITIAL_WAIT: ${{ vars.CRATES_IO_INITIAL_WAIT || 'not set (will use default: 180)' }}" - echo "CRATES_IO_RETRY_WAIT: ${{ vars.CRATES_IO_RETRY_WAIT || 'not set (will use default: 60)' }}" - + echo "PUBLISH_INITIAL_WAIT: ${{ vars.PUBLISH_INITIAL_WAIT || 'not set (will use default: 180)' }}" + echo "PUBLISH_RETRY_WAIT: ${{ vars.PUBLISH_RETRY_WAIT || 'not set (will use default: 60)' }}" + echo "✅ All required context tokens are present!" audit: @@ -171,6 +171,39 @@ jobs: --no-confirm \ --execute + - name: Verify crates.io publication + run: | + PACKAGE_NAME="hyprsession" + VERSION=$(grep '^version = ' Cargo.toml | head -1 | sed 's/.*"\(.*\)".*/\1/' | sed 's/-.*//') + INITIAL_WAIT=${{ vars.PUBLISH_INITIAL_WAIT || 10 }} + RETRY_WAIT=${{ vars.PUBLISH_RETRY_WAIT || 10 }} + MAX_ATTEMPTS=6 + + echo "Verifying publication of $PACKAGE_NAME v$VERSION on crates.io..." + echo "Using INITIAL_WAIT=${INITIAL_WAIT}s, RETRY_WAIT=${RETRY_WAIT}s" + + # Wait for crates.io to update + echo "Waiting ${INITIAL_WAIT}s for crates.io to update..." + sleep $INITIAL_WAIT + + # Check if the version is available + ATTEMPT=0 + while [ $ATTEMPT -lt $MAX_ATTEMPTS ]; do + echo "Attempt $((ATTEMPT + 1))/$MAX_ATTEMPTS: Checking crates.io..." + if curl -s "https://crates.io/api/v1/crates/$PACKAGE_NAME" | grep -q "\"vers\":\"$VERSION\""; then + echo "✓ Successfully verified $PACKAGE_NAME v$VERSION is published on crates.io" + exit 0 + fi + ATTEMPT=$((ATTEMPT + 1)) + if [ $ATTEMPT -lt $MAX_ATTEMPTS ]; then + echo "Version not found yet, waiting ${RETRY_WAIT}s..." + sleep $RETRY_WAIT + fi + done + + echo "✗ Failed to verify publication on crates.io after $MAX_ATTEMPTS attempts" + exit 1 + aur_publish: name: Publish (AUR) needs: @@ -216,27 +249,27 @@ jobs: license=('GPL-3.0-or-later') depends=() makedepends=('rust' 'cargo') - source=("$pkgname-$pkgver.tar.gz::https://github.com/joshurtree/hyprsession/archive/refs/tags/v$pkgver.tar.gz") + source=("\$pkgname-\$pkgver.tar.gz::https://github.com/joshurtree/hyprsession/archive/refs/tags/v\$pkgver.tar.gz") sha256sums=('${{ steps.checksum.outputs.checksum }}') build() { - cd "$pkgname-$pkgver" + cd "\$pkgname-\$pkgver" export RUSTUP_TOOLCHAIN=stable export CARGO_TARGET_DIR=target cargo build --frozen --release --all-features } check() { - cd "$pkgname-$pkgver" + cd "\$pkgname-\$pkgver" export RUSTUP_TOOLCHAIN=stable cargo test --frozen --all-features } package() { - cd "$pkgname-$pkgver" - install -Dm755 "target/release/$pkgname" "$pkgdir/usr/bin/$pkgname" - install -Dm644 "README.md" "$pkgdir/usr/share/doc/$pkgname/README.md" - install -Dm644 "LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE" + cd "\$pkgname-\$pkgver" + install -Dm755 "target/release/\$pkgname" "\$pkgdir/usr/bin/\$pkgname" + install -Dm644 "README.md" "\$pkgdir/usr/share/doc/\$pkgname/README.md" + install -Dm644 "LICENSE" "\$pkgdir/usr/share/licenses/\$pkgname/LICENSE" } EOF @@ -250,3 +283,48 @@ jobs: ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }} commit_message: "Update to version ${{ steps.version.outputs.version }}" ssh_keyscan_types: rsa,ecdsa,ed25519 + + - name: Verify AUR publication + run: | + PACKAGE_NAME="hyprsession" + VERSION="${{ steps.version.outputs.version }}" + INITIAL_WAIT=${{ vars.PUBLISH_INITIAL_WAIT || 15 }} + RETRY_WAIT=${{ vars.PUBLISH_RETRY_WAIT || 15 }} + MAX_ATTEMPTS=4 + + echo "Verifying publication of $PACKAGE_NAME v$VERSION on AUR..." + echo "Using INITIAL_WAIT=${INITIAL_WAIT}s, RETRY_WAIT=${RETRY_WAIT}s" + + # Wait for AUR to update + echo "Waiting ${INITIAL_WAIT}s for AUR to update..." + sleep $INITIAL_WAIT + + # Check if the package is available via AUR RPC API + ATTEMPT=0 + while [ $ATTEMPT -lt $MAX_ATTEMPTS ]; do + echo "Attempt $((ATTEMPT + 1))/$MAX_ATTEMPTS: Checking AUR..." + RESPONSE=$(curl -s "https://aur.archlinux.org/rpc/?v=5&type=info&arg=$PACKAGE_NAME") + + if echo "$RESPONSE" | grep -q "\"resultcount\":1"; then + CURRENT_VERSION=$(echo "$RESPONSE" | grep -oP '"Version":"[^"]*"' | cut -d'"' -f4) + echo "Found package on AUR with version: $CURRENT_VERSION" + + if [ "$CURRENT_VERSION" = "$VERSION" ]; then + echo "✓ Successfully verified $PACKAGE_NAME v$VERSION is published on AUR" + exit 0 + else + echo "Version mismatch: expected $VERSION, found $CURRENT_VERSION" + fi + else + echo "Package not found on AUR yet" + fi + + ATTEMPT=$((ATTEMPT + 1)) + if [ $ATTEMPT -lt $MAX_ATTEMPTS ]; then + echo "Waiting ${RETRY_WAIT}s before retry..." + sleep $RETRY_WAIT + fi + done + + echo "✗ Failed to verify publication on AUR after $MAX_ATTEMPTS attempts" + exit 1 From be85fbf814c5fa3d767c6cceed57ee2a61f4e7cb Mon Sep 17 00:00:00 2001 From: Josh Andrews Date: Wed, 31 Dec 2025 18:33:00 +0000 Subject: [PATCH 08/12] Improved version tagging, escaped pkgbuild variables and created a verification step after publish --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0f89af9..0aac3f7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -255,7 +255,7 @@ dependencies = [ [[package]] name = "hyprsession" -version = "0.2.0-5" +version = "0.2.0-6" dependencies = [ "clap", "hyprland", diff --git a/Cargo.toml b/Cargo.toml index 6426842..aed5bcc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hyprsession" -version = "0.2.0-5" +version = "0.2.0-6" edition = "2021" authors = [ "Josh Andrews" ] license = "GPL-3.0" From 504aa9a3577b9dc8b5ff95d8abd1154ea2b842ef Mon Sep 17 00:00:00 2001 From: Josh Andrews Date: Wed, 31 Dec 2025 18:53:24 +0000 Subject: [PATCH 09/12] Improved version tagging, escaped pkgbuild variables and created a verification step after publish --- .github/workflows/publish.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 575aa5e..950f90d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -101,8 +101,8 @@ jobs: id: version run: | VERSION=$(grep '^version = ' Cargo.toml | head -1 | sed 's/.*"\(.*\)".*/\1/' | sed 's/-.*//') - echo "version=$VERSION" >> $GITHUB_OUTPUT - echo "release=$RELEASE_SUFFIX" >> $GITHUB_OUTPUT + echo "::set-output name=version::$VERSION" + echo "::set-output name=release::$RELEASE_SUFFIX" echo "Version detected: $VERSION" echo "Release suffix detected: $RELEASE_SUFFIX" echo "Full version detected: $FULL_VERSION" @@ -167,7 +167,7 @@ jobs: publish \ --workspace \ --all-features \ - --allow-branch main \ + --allow-branch ${{ github.ref_name }} \ --no-confirm \ --execute @@ -222,8 +222,8 @@ jobs: FULL_VERSION=$(grep '^version = ' Cargo.toml | head -1 | sed 's/.*"\(.*\)".*/\1/') VERSION=$(echo "$FULL_VERSION" | sed 's/-.*//') RELEASE_SUFFIX=$(echo "$FULL_VERSION" | grep -oP '(?<=-).*$' || echo "1") - echo "version=$VERSION" >> $GITHUB_OUTPUT - echo "release=$RELEASE_SUFFIX" >> $GITHUB_OUTPUT + echo "::set-output name=version::$VERSION" + echo "::set-output name=release::$RELEASE_SUFFIX" echo "Version detected: $VERSION" echo "Release suffix detected: $RELEASE_SUFFIX" @@ -233,7 +233,7 @@ jobs: # Create a temporary tarball from the repository git archive --format=tar.gz --prefix=hyprsession-${{ steps.version.outputs.version }}/ HEAD > hyprsession-${{ steps.version.outputs.version }}.tar.gz SHA256=$(sha256sum hyprsession-${{ steps.version.outputs.version }}.tar.gz | cut -d' ' -f1) - echo "checksum=$SHA256" >> $GITHUB_OUTPUT + echo "::set-output name=checksum::$SHA256" echo "SHA256: $SHA256" - name: Generate PKGBUILD file @@ -287,7 +287,7 @@ jobs: - name: Verify AUR publication run: | PACKAGE_NAME="hyprsession" - VERSION="${{ steps.version.outputs.version }}" + VERSION="${{ steps.version.outputs.version }}-${{ steps.version.outputs.release }}" INITIAL_WAIT=${{ vars.PUBLISH_INITIAL_WAIT || 15 }} RETRY_WAIT=${{ vars.PUBLISH_RETRY_WAIT || 15 }} MAX_ATTEMPTS=4 From 15b6325882daa89b70bc8eb3e97ad1b220347daf Mon Sep 17 00:00:00 2001 From: Josh Andrews Date: Wed, 31 Dec 2025 19:13:47 +0000 Subject: [PATCH 10/12] Improved version tagging, escaped pkgbuild variables and created a verification step after publish --- .github/workflows/publish.yml | 16 +++++++++--- tests/test-aur.sh | 48 +++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 4 deletions(-) create mode 100755 tests/test-aur.sh diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 950f90d..c6b02bc 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -227,14 +227,22 @@ jobs: echo "Version detected: $VERSION" echo "Release suffix detected: $RELEASE_SUFFIX" - - name: Get SHA256 checksum from repository + - name: Get SHA256 checksum from GitHub release id: checksum run: | - # Create a temporary tarball from the repository - git archive --format=tar.gz --prefix=hyprsession-${{ steps.version.outputs.version }}/ HEAD > hyprsession-${{ steps.version.outputs.version }}.tar.gz - SHA256=$(sha256sum hyprsession-${{ steps.version.outputs.version }}.tar.gz | cut -d' ' -f1) + VERSION="${{ steps.version.outputs.version }}" + URL="https://github.com/joshurtree/hyprsession/archive/refs/tags/v${VERSION}.tar.gz" + + echo "Downloading release tarball from: $URL" + curl -L -o "hyprsession-${VERSION}.tar.gz" "$URL" + + SHA256=$(sha256sum "hyprsession-${VERSION}.tar.gz" | cut -d' ' -f1) echo "::set-output name=checksum::$SHA256" echo "SHA256: $SHA256" + + # Verify the tarball can be extracted + tar -tzf "hyprsession-${VERSION}.tar.gz" >/dev/null + echo "✓ Tarball verified successfully" - name: Generate PKGBUILD file run: |- diff --git a/tests/test-aur.sh b/tests/test-aur.sh new file mode 100755 index 0000000..3900bfa --- /dev/null +++ b/tests/test-aur.sh @@ -0,0 +1,48 @@ +#!/usr/bin/env bash + +# Quick Arch Linux container for testing AUR packages +# Run with: nix-shell arch-container.nix --run ./test-aur.sh + +set -e + +echo "Starting Arch Linux container for AUR testing..." + +# Run an Arch container with necessary tools +docker run -it --rm \ + -v "$(pwd):/workspace:ro" \ + archlinux:latest \ + bash -c ' + # Update system and install build tools + pacman -Syu --noconfirm + pacman -S --noconfirm base-devel git sudo + + # Create a build user (AUR packages cannot be built as root) + useradd -m builder + echo "builder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers + + # Switch to builder user + su - builder -c " + # Clone and build the AUR package + cd /tmp + git clone https://aur.archlinux.org/hyprsession.git + cd hyprsession + + echo \"\" + echo \"=== PKGBUILD Contents ===\" + cat PKGBUILD + echo \"\" + echo \"=== Building package ===\" + makepkg -si --noconfirm + + echo \"\" + echo \"=== Testing installation ===\" + hyprsession --version || echo \"Package installed but hyprsession command not found\" + + echo \"\" + echo \"=== Package info ===\" + pacman -Qi hyprsession + " + ' + +echo "" +echo "AUR package test complete!" From 76a8318a06b2ca7bf51439294d8e109a39f1e19c Mon Sep 17 00:00:00 2001 From: Josh Andrews Date: Wed, 31 Dec 2025 19:31:54 +0000 Subject: [PATCH 11/12] Improved version tagging, escaped pkgbuild variables and created a verification step after publish --- .github/workflows/publish.yml | 4 ++-- Cargo.lock | 2 +- Cargo.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c6b02bc..3d01e76 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -264,13 +264,13 @@ jobs: cd "\$pkgname-\$pkgver" export RUSTUP_TOOLCHAIN=stable export CARGO_TARGET_DIR=target - cargo build --frozen --release --all-features + cargo build --release --all-features } check() { cd "\$pkgname-\$pkgver" export RUSTUP_TOOLCHAIN=stable - cargo test --frozen --all-features + cargo test --release --all-features } package() { diff --git a/Cargo.lock b/Cargo.lock index 0aac3f7..fd8341a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -255,7 +255,7 @@ dependencies = [ [[package]] name = "hyprsession" -version = "0.2.0-6" +version = "0.2.0-7" dependencies = [ "clap", "hyprland", diff --git a/Cargo.toml b/Cargo.toml index aed5bcc..1886e3b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hyprsession" -version = "0.2.0-6" +version = "0.2.0-7" edition = "2021" authors = [ "Josh Andrews" ] license = "GPL-3.0" From b80d2b773d5212567023c5a6055467c3d2b04a9a Mon Sep 17 00:00:00 2001 From: Josh Andrews Date: Wed, 31 Dec 2025 19:57:26 +0000 Subject: [PATCH 12/12] Improved version tagging and fixed aur publishing bugs --- .github/workflows/publish.yml | 80 +---------------------------------- 1 file changed, 1 insertion(+), 79 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 3d01e76..7effb3c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -171,39 +171,6 @@ jobs: --no-confirm \ --execute - - name: Verify crates.io publication - run: | - PACKAGE_NAME="hyprsession" - VERSION=$(grep '^version = ' Cargo.toml | head -1 | sed 's/.*"\(.*\)".*/\1/' | sed 's/-.*//') - INITIAL_WAIT=${{ vars.PUBLISH_INITIAL_WAIT || 10 }} - RETRY_WAIT=${{ vars.PUBLISH_RETRY_WAIT || 10 }} - MAX_ATTEMPTS=6 - - echo "Verifying publication of $PACKAGE_NAME v$VERSION on crates.io..." - echo "Using INITIAL_WAIT=${INITIAL_WAIT}s, RETRY_WAIT=${RETRY_WAIT}s" - - # Wait for crates.io to update - echo "Waiting ${INITIAL_WAIT}s for crates.io to update..." - sleep $INITIAL_WAIT - - # Check if the version is available - ATTEMPT=0 - while [ $ATTEMPT -lt $MAX_ATTEMPTS ]; do - echo "Attempt $((ATTEMPT + 1))/$MAX_ATTEMPTS: Checking crates.io..." - if curl -s "https://crates.io/api/v1/crates/$PACKAGE_NAME" | grep -q "\"vers\":\"$VERSION\""; then - echo "✓ Successfully verified $PACKAGE_NAME v$VERSION is published on crates.io" - exit 0 - fi - ATTEMPT=$((ATTEMPT + 1)) - if [ $ATTEMPT -lt $MAX_ATTEMPTS ]; then - echo "Version not found yet, waiting ${RETRY_WAIT}s..." - sleep $RETRY_WAIT - fi - done - - echo "✗ Failed to verify publication on crates.io after $MAX_ATTEMPTS attempts" - exit 1 - aur_publish: name: Publish (AUR) needs: @@ -290,49 +257,4 @@ jobs: commit_email: ${{ secrets.AUR_EMAIL }} ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }} commit_message: "Update to version ${{ steps.version.outputs.version }}" - ssh_keyscan_types: rsa,ecdsa,ed25519 - - - name: Verify AUR publication - run: | - PACKAGE_NAME="hyprsession" - VERSION="${{ steps.version.outputs.version }}-${{ steps.version.outputs.release }}" - INITIAL_WAIT=${{ vars.PUBLISH_INITIAL_WAIT || 15 }} - RETRY_WAIT=${{ vars.PUBLISH_RETRY_WAIT || 15 }} - MAX_ATTEMPTS=4 - - echo "Verifying publication of $PACKAGE_NAME v$VERSION on AUR..." - echo "Using INITIAL_WAIT=${INITIAL_WAIT}s, RETRY_WAIT=${RETRY_WAIT}s" - - # Wait for AUR to update - echo "Waiting ${INITIAL_WAIT}s for AUR to update..." - sleep $INITIAL_WAIT - - # Check if the package is available via AUR RPC API - ATTEMPT=0 - while [ $ATTEMPT -lt $MAX_ATTEMPTS ]; do - echo "Attempt $((ATTEMPT + 1))/$MAX_ATTEMPTS: Checking AUR..." - RESPONSE=$(curl -s "https://aur.archlinux.org/rpc/?v=5&type=info&arg=$PACKAGE_NAME") - - if echo "$RESPONSE" | grep -q "\"resultcount\":1"; then - CURRENT_VERSION=$(echo "$RESPONSE" | grep -oP '"Version":"[^"]*"' | cut -d'"' -f4) - echo "Found package on AUR with version: $CURRENT_VERSION" - - if [ "$CURRENT_VERSION" = "$VERSION" ]; then - echo "✓ Successfully verified $PACKAGE_NAME v$VERSION is published on AUR" - exit 0 - else - echo "Version mismatch: expected $VERSION, found $CURRENT_VERSION" - fi - else - echo "Package not found on AUR yet" - fi - - ATTEMPT=$((ATTEMPT + 1)) - if [ $ATTEMPT -lt $MAX_ATTEMPTS ]; then - echo "Waiting ${RETRY_WAIT}s before retry..." - sleep $RETRY_WAIT - fi - done - - echo "✗ Failed to verify publication on AUR after $MAX_ATTEMPTS attempts" - exit 1 + ssh_keyscan_types: rsa,ecdsa,ed25519 \ No newline at end of file