Skip to content

Commit

Permalink
ci: add aur
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhermeprokisch committed Sep 14, 2024
1 parent ec14300 commit b990b03
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions .github/workflows/tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
env:
GH_TOKEN: ${{ secrets.RELEASE_BOT }}

publish-crates-io:
publish:
name: Publish to crates.io
needs: create-tag
if: needs.create-tag.outputs.version != ''
Expand All @@ -63,8 +63,11 @@ jobs:
--verbose
--locked
--token ${{ secrets.CARGO_REGISTRY_TOKEN }}
publish-aur:
name: Publish to AUR
needs: [create-tag, publish]
if: needs.create-tag.outputs.version != ''
runs-on: ubuntu-latest
environment: AUR
steps:
Expand All @@ -78,20 +81,32 @@ jobs:
run: cargo install cargo-aur
- name: Generate PKGBUILD
run: cargo aur
- name: Publish AUR package
- name: Setup SSH key
env:
AUR_SSH_PRIVATE_KEY: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
run: |
mkdir -p ~/.ssh
echo "$AUR_SSH_PRIVATE_KEY" > ~/.ssh/aur
chmod 600 ~/.ssh/aur
git config --global user.name "GitHub Action"
git config --global user.email "action@github.com"
cargo aur publish
echo "Host aur.archlinux.org" >> ~/.ssh/config
echo " IdentityFile ~/.ssh/aur" >> ~/.ssh/config
ssh-keyscan aur.archlinux.org >> ~/.ssh/known_hosts
- name: Clone AUR package
run: git clone ssh://aur@aur.archlinux.org/see.git aur-repo
- name: Update AUR package
run: |
cp PKGBUILD aur-repo/
cd aur-repo
makepkg --printsrcinfo > .SRCINFO
git config user.name "GitHub Action"
git config user.email "action@github.com"
git add PKGBUILD .SRCINFO
git commit -m "Update to version ${{ needs.create-tag.outputs.version }}"
git push
cleanup-pr-labels:
name: Remove labels from release PR
needs: [create-tag, publish-crates-io, publish-aur]
needs: [create-tag, publish, publish-aur]
if: needs.create-tag.outputs.version != ''
runs-on: ubuntu-latest
steps:
Expand Down

0 comments on commit b990b03

Please # to comment.