Skip to content

Commit

Permalink
Testing new workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
TheWisker committed Jun 30, 2023
1 parent 42022bc commit 2ace827
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 346 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ body:
- type: markdown
attributes:
value: |
# ShikaiFeature Request
# Shikai Feature Request
Thanks for taking the time to fill out this feature request!
- type: textarea
id: explanation
Expand Down
168 changes: 5 additions & 163 deletions .github/workflows/aur_update.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: aur-update
name: AUR Update
run-name: AUR package update by ${{ github.actor }} release
on:
release:
Expand All @@ -17,166 +17,8 @@ jobs:
image: archlinux
options: --privileged
steps:
- name: Setup Runtime
env:
aur_key: ${{ secrets.AUR_KEY }}
aur_public_key: ${{ secrets.AUR_PKEY }}
run: |
pacman -Syy --noconfirm --needed base-devel git openssh
echo "Installed Runtime Packages"
mkdir -p /root/.ssh/
echo "Host *
IdentityFile /root/.ssh/aur
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
" > /root/.ssh/config
echo "${aur_key}" > /root/.ssh/aur
echo "${aur_public_key}" > /root/.ssh/aur.pub
chmod 0700 /root/.ssh/aur
chmod 0700 /root/.ssh/aur.pub
echo "Configured SSH Credentials"
- name: Configure Git Credentials
shell: bash
env:
username: ${{ github.actor }}
email: [email protected]
repo_name: ${{ github.event.repository.name }}
run: |
git config --global user.name $username
git config --global user.email $email
git config --global init.defaultBranch master
git config --global --add safe.directory /__w/$repo_name/$repo_name
echo "Configured Git Credentials"
- name: Checkout
uses: actions/checkout@v3
- name: AUR Update
uses: TheWisker/aur-update@latest
with:
ref: master

- name: Update local from AUR
shell: bash
env:
aur_folder: ./aur
run: |
mv ./.git ./.not_git
for folder in $aur_folder/*/; do
pushd $folder
folder_name=$(basename "${folder}")
git init
git remote add aur ssh://[email protected]/$folder_name.git
git fetch
mkdir ./_tmp
for file in $(find . -mindepth 1 -maxdepth 1 -not -name ".git" -not -name "_tmp"); do
mv "$file" ./_tmp
done
git pull aur master
for file in $(find ./_tmp -mindepth 1 -maxdepth 1); do
if ! [[ -f "./$(basename "$file")" ]]; then
mv "$file" .
fi
done
rm -fr ./_tmp
echo "Updated local $folder_name from AUR"
popd
done
- name: Update PKGBUILDs and .SRCINFOs
shell: bash
env:
aur_folder: ./aur
tag_name: ${{ github.event.release.tag_name }}
run: |
for folder in $aur_folder/*/; do
#Check if PKGBUILD file exists in the folder
if [[ -f "${folder}PKGBUILD" ]]; then
# Replace the pkgrel value with the updated one
sed -i "s/^pkgrel=.*/pkgrel=1/" "${folder}PKGBUILD"
echo "Updated pkgrel to 1 in ${folder}PKGBUILD"
# Replace the pkgver value with the updated one
sed -i "s/^pkgver=.*/pkgver=$tag_name/" "${folder}PKGBUILD"
echo "Updated pkgver to $tag_name in ${folder}PKGBUILD"
fi
#Check if .SRCINFO file exists in the folder
if [[ -f "${folder}.SRCINFO" ]]; then
# Replace the pkgrel value with the updated one
sed -i "s/^\([[:space:]]*pkgrel =\).*/\1 1/" "${folder}.SRCINFO"
echo "Updated pkgrel to 1 in ${folder}.SRCINFO"
# Replace the pkgver value with the updated one
sed -i "s/^\([[:space:]]*pkgver =\).*/\1 $tag_name/" "${folder}.SRCINFO"
sed -i "s/\(#tag=\).*$/\1$tag_name/" "${folder}.SRCINFO"
echo "Updated pkgver to $tag_name in ${folder}.SRCINFO"
fi
done
- name: Update AUR
shell: bash
env:
aur_folder: "./aur"
tag_name: ${{ github.event.release.tag_name }}
run: |
for folder in $aur_folder/*/; do
# Only run if it has a PKGBUILD file
if [[ -f "${folder}PKGBUILD" ]]; then
# Only run if it has a .SRCINFO file
if [[ -f "${folder}.SRCINFO" ]]; then
pushd $folder
if [[ -d "./.git" ]]; then
git add .
git commit -m "Github Automated: ${tag_name}"
git push --set-upstream aur master
rm -fr .git
echo $folder_name package was updated!
fi
popd
else
echo $folder_name package lacks a .SRCINFO file
exit 1
fi
else
echo $folder_name package lacks a PKGBUILD file
exit 1
fi
done
- name: Update Repository
shell: bash
run: |
mv ./.not_git ./.git
git add .
git commit -m "Automatic AUR Update"
git push
echo "Updated Repository"
username: TheWisker
email: [email protected]
185 changes: 7 additions & 178 deletions .github/workflows/aur_update_git.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: aur-update-git
run-name: AUR package update by ${{ github.actor }} commit
name: AUR Update Git
run-name: AUR package update by ${{ github.actor }} push
on:
push:
branches:
Expand All @@ -18,179 +18,8 @@ jobs:
image: archlinux
options: --privileged
steps:
- name: Setup Runtime
env:
aur_key: ${{ secrets.AUR_KEY }}
aur_public_key: ${{ secrets.AUR_PKEY }}
run: |
pacman -Syy --noconfirm --needed base-devel git openssh
echo "Installed Runtime Packages"
mkdir -p /root/.ssh/
echo "Host *
IdentityFile /root/.ssh/aur
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
" > /root/.ssh/config
echo "${aur_key}" > /root/.ssh/aur
echo "${aur_public_key}" > /root/.ssh/aur.pub
chmod 0700 /root/.ssh/aur
chmod 0700 /root/.ssh/aur.pub
echo "Configured SSH Credentials"
- name: Configure Git Credentials
shell: bash
env:
username: ${{ github.actor }}
email: ${{ github.event.push.pusher.email }}
repo_name: ${{ github.event.repository.name }}
run: |
git config --global user.name $username
git config --global user.email ${email:[email protected]}
git config --global init.defaultBranch master
git config --global --add safe.directory /__w/$repo_name/$repo_name
echo "Configured Git Credentials"
- name: Checkout
uses: actions/checkout@v3

- name: Update local from AUR
shell: bash
env:
aur_folder: ./aur
run: |
mv ./.git ./.not_git
for folder in $aur_folder/*/; do
folder_name=$(basename "${folder}")
# Only run if it is a pkgbase-git aur package
if [[ $folder_name == *-git ]]; then
pushd $folder
git init
git remote add aur ssh://[email protected]/$folder_name.git
git fetch
mkdir ./_tmp
for file in $(find . -mindepth 1 -maxdepth 1 -not -name ".git" -not -name "_tmp"); do
mv "$file" ./_tmp
done
git pull aur master
for file in $(find ./_tmp -mindepth 1 -maxdepth 1); do
if ! [[ -f "./$(basename "$file")" ]]; then
mv "$file" .
fi
done
rm -fr ./_tmp
echo "Updated local $folder_name from AUR"
popd
fi
done
- name: Update PKGBUILDs and .SRCINFOs
shell: bash
env:
aur_folder: ./aur
run: |
for folder in $aur_folder/*/; do
folder_name=$(basename "${folder}")
# Only run if it is a pkgbase-git aur package
if [[ $folder_name == *-git ]]; then
#Check if PKGBUILD file exists in the folder
if [[ -f "${folder}PKGBUILD" ]]; then
pkgrel_line=$(grep -e '^pkgrel=' "${folder}PKGBUILD")
# Extract the current pkgrel value
current_pkgrel=$(echo "$pkgrel_line" | cut -d '=' -f2)
new_pkgrel=$((current_pkgrel + 1))
# Replace the pkgrel value with the updated one
sed -i "s/^pkgrel=.*/pkgrel=$new_pkgrel/" "${folder}PKGBUILD"
echo "Updated pkgrel to $new_pkgrel in ${folder}PKGBUILD"
fi
#Check if .SRCINFO file exists in the folder
if [[ -f "${folder}.SRCINFO" ]]; then
if ! [ -v new_pkgrel ]; then
pkgrel_line=$(grep -e '^[[:space:]]*pkgrel =' "${folder}.SRCINFO")
# Extract the current pkgrel value
current_pkgrel=$(echo "$pkgrel_line" | awk -F ' = ' '{print $2}')
new_pkgrel=$((current_pkgrel + 1))
fi
# Replace the pkgrel value with the updated one
sed -i "s/^\([[:space:]]*pkgrel =\).*/\1 $new_pkgrel/" "${folder}.SRCINFO"
echo "Updated pkgrel to $new_pkgrel in ${folder}.SRCINFO"
fi
fi
done
- name: Update AUR
shell: bash
env:
aur_folder: "./aur"
commit_hash: ${{ github.event.push.after }}
run: |
for folder in $aur_folder/*/; do
folder_name=$(basename "${folder}")
# Only run if it is a pkgbase-git aur package
if [[ $folder_name == *-git ]]; then
# Only run if it has a PKGBUILD file
if [[ -f "${folder}PKGBUILD" ]]; then
# Only run if it has a .SRCINFO file
if [[ -f "${folder}.SRCINFO" ]]; then
pushd $folder
if [[ -d "./.git" ]]; then
git add .
git commit -m "Github Automated: ${commit_hash}"
git push --set-upstream aur master
rm -fr .git
echo $folder_name package was updated!
fi
popd
else
echo $folder_name package lacks a .SRCINFO file
exit 1
fi
else
echo $folder_name package lacks a PKGBUILD file
exit 1
fi
fi
done
- name: Update Repository
shell: bash
run: |
mv ./.not_git ./.git
git add .
git commit -m "Automatic AUR Update"
git push
echo "Updated Repository"
- name: AUR Update Git
uses: TheWisker/aur-update-git@latest
with:
username: TheWisker
email: [email protected]
6 changes: 4 additions & 2 deletions .github/workflows/deploy_pages.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: deploy-pages
run-name: Page deployment by ${{ github.actor }} commit
name: Deploy Pages
run-name: Page deployment by ${{ github.actor }}
on:
push:
branches:
Expand All @@ -21,6 +21,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.sha }}

- name: Setup Pages
uses: actions/configure-pages@v2
Expand Down
Loading

0 comments on commit 2ace827

Please sign in to comment.