mirror of
https://github.com/neosubhamoy/neodlp.git
synced 2025-12-19 03:52:58 +05:30
ci: switched aur publish workflow to gitea
This commit is contained in:
@@ -1,6 +1,4 @@
|
|||||||
on:
|
on: workflow_dispatch
|
||||||
release:
|
|
||||||
types: [published]
|
|
||||||
|
|
||||||
name: 🚀 Publish to AUR
|
name: 🚀 Publish to AUR
|
||||||
jobs:
|
jobs:
|
||||||
@@ -27,11 +25,11 @@ jobs:
|
|||||||
# If manually triggered, fetch latest release
|
# If manually triggered, fetch latest release
|
||||||
RELEASE_TAG=$(curl -s "https://api.github.com/repos/${{ github.repository }}/releases/latest" | jq -r '.tag_name')
|
RELEASE_TAG=$(curl -s "https://api.github.com/repos/${{ github.repository }}/releases/latest" | jq -r '.tag_name')
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Extract version number from tag
|
# Extract version number from tag
|
||||||
VERSION=$(echo "$RELEASE_TAG" | sed -E 's/^v([0-9]+\.[0-9]+\.[0-9]+)(-.*)?$/\1/')
|
VERSION=$(echo "$RELEASE_TAG" | sed -E 's/^v([0-9]+\.[0-9]+\.[0-9]+)(-.*)?$/\1/')
|
||||||
SUFFIX=$(echo "$RELEASE_TAG" | sed -E 's/^v[0-9]+\.[0-9]+\.[0-9]+(-.*)?$/\1/')
|
SUFFIX=$(echo "$RELEASE_TAG" | sed -E 's/^v[0-9]+\.[0-9]+\.[0-9]+(-.*)?$/\1/')
|
||||||
|
|
||||||
echo "release_tag=$RELEASE_TAG" >> $GITHUB_OUTPUT
|
echo "release_tag=$RELEASE_TAG" >> $GITHUB_OUTPUT
|
||||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||||
echo "suffix=$SUFFIX" >> $GITHUB_OUTPUT
|
echo "suffix=$SUFFIX" >> $GITHUB_OUTPUT
|
||||||
@@ -39,15 +37,15 @@ jobs:
|
|||||||
- name: 🔑 Setup SSH for AUR
|
- name: 🔑 Setup SSH for AUR
|
||||||
run: |
|
run: |
|
||||||
mkdir -p ~/.ssh
|
mkdir -p ~/.ssh
|
||||||
|
|
||||||
# Write key with proper newline handling
|
# Write key with proper newline handling
|
||||||
echo "${{ secrets.AUR_SSH_PRIVATE_KEY }}" | sed 's/\\n/\n/g' > ~/.ssh/id_rsa
|
echo "${{ secrets.AUR_SSH_PRIVATE_KEY }}" | sed 's/\\n/\n/g' > ~/.ssh/id_rsa
|
||||||
|
|
||||||
# Set proper permissions
|
# Set proper permissions
|
||||||
chmod 600 ~/.ssh/id_rsa
|
chmod 600 ~/.ssh/id_rsa
|
||||||
ssh-keyscan aur.archlinux.org >> ~/.ssh/known_hosts
|
ssh-keyscan aur.archlinux.org >> ~/.ssh/known_hosts
|
||||||
chmod 600 ~/.ssh/known_hosts
|
chmod 600 ~/.ssh/known_hosts
|
||||||
|
|
||||||
# Create SSH config file
|
# Create SSH config file
|
||||||
cat > ~/.ssh/config << EOF
|
cat > ~/.ssh/config << EOF
|
||||||
Host aur.archlinux.org
|
Host aur.archlinux.org
|
||||||
@@ -66,7 +64,7 @@ jobs:
|
|||||||
git config --global user.name "${{ secrets.AUR_USER }}"
|
git config --global user.name "${{ secrets.AUR_USER }}"
|
||||||
git config --global user.email "${{ secrets.AUR_EMAIL }}"
|
git config --global user.email "${{ secrets.AUR_EMAIL }}"
|
||||||
git config --global --add safe.directory '*'
|
git config --global --add safe.directory '*'
|
||||||
|
|
||||||
# Clone AUR repository
|
# Clone AUR repository
|
||||||
GIT_SSH_COMMAND="ssh -v -i ~/.ssh/id_rsa -o StrictHostKeyChecking=accept-new" \
|
GIT_SSH_COMMAND="ssh -v -i ~/.ssh/id_rsa -o StrictHostKeyChecking=accept-new" \
|
||||||
git clone "ssh://aur@aur.archlinux.org/neodlp.git" aur-repo
|
git clone "ssh://aur@aur.archlinux.org/neodlp.git" aur-repo
|
||||||
@@ -77,21 +75,21 @@ jobs:
|
|||||||
|
|
||||||
# Update PKGBUILD version
|
# Update PKGBUILD version
|
||||||
sed -i "s/pkgver=.*/pkgver=${VERSION}/" PKGBUILD
|
sed -i "s/pkgver=.*/pkgver=${VERSION}/" PKGBUILD
|
||||||
|
|
||||||
# Create non-root user for makepkg (which refuses to run as root)
|
# Create non-root user for makepkg (which refuses to run as root)
|
||||||
useradd -m builder
|
useradd -m builder
|
||||||
chown -R builder:builder .
|
chown -R builder:builder .
|
||||||
|
|
||||||
# Generate .SRCINFO using makepkg
|
# Generate .SRCINFO using makepkg
|
||||||
su builder -c "makepkg --printsrcinfo" > .SRCINFO
|
su builder -c "makepkg --printsrcinfo" > .SRCINFO
|
||||||
|
|
||||||
# Debug output
|
# Debug output
|
||||||
echo "PKGBUILD:"
|
echo "PKGBUILD:"
|
||||||
cat PKGBUILD
|
cat PKGBUILD
|
||||||
|
|
||||||
echo ".SRCINFO:"
|
echo ".SRCINFO:"
|
||||||
cat .SRCINFO
|
cat .SRCINFO
|
||||||
|
|
||||||
# Check if there are any changes to commit
|
# Check if there are any changes to commit
|
||||||
if [ -n "$(git status --porcelain)" ]; then
|
if [ -n "$(git status --porcelain)" ]; then
|
||||||
echo "Changes detected, committing and pushing..."
|
echo "Changes detected, committing and pushing..."
|
||||||
@@ -108,4 +106,4 @@ jobs:
|
|||||||
- name: 🔍 Verify update
|
- name: 🔍 Verify update
|
||||||
run: |
|
run: |
|
||||||
echo "Successfully updated AUR package to version ${{ steps.release_info.outputs.version }}${{ steps.release_info.outputs.suffix }}"
|
echo "Successfully updated AUR package to version ${{ steps.release_info.outputs.version }}${{ steps.release_info.outputs.suffix }}"
|
||||||
echo "View the updated package at: https://aur.archlinux.org/packages/neodlp"
|
echo "View the updated package at: https://aur.archlinux.org/packages/neodlp"
|
||||||
Reference in New Issue
Block a user