From b990b038fa7f72db7647360feb13815d3dee23ec Mon Sep 17 00:00:00 2001 From: Guilherme Prokisch Date: Sat, 14 Sep 2024 22:00:13 +0200 Subject: [PATCH] ci: add aur --- .github/workflows/tag.yaml | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tag.yaml b/.github/workflows/tag.yaml index a5916cc..18fc966 100644 --- a/.github/workflows/tag.yaml +++ b/.github/workflows/tag.yaml @@ -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 != '' @@ -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: @@ -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: