ci(aur): use new AUR workflow & use git+https protocol #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Update AUR" | |
on: | |
push: | |
branches: | |
- master | |
paths-ignore: | |
- "**.md" | |
- ".gitignore" | |
jobs: | |
aur: | |
name: "Update AUR" | |
runs-on: ubuntu-latest | |
if: github.repository_owner == 'ouuan' | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Get Version | |
id: get-version | |
run: echo "::set-output name=version::$(git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g')" | |
- name: Update PKGBUILD | |
run: | | |
sed -i "s/@VERSION@/${{ steps.get-version.outputs.version }}/" aur/git/PKGBUILD | |
- name: Check PKGBUILD | |
uses: ouuan/pkgbuild-action@master | |
with: | |
path: aur/git | |
- name: Install SSH key | |
uses: shimataro/ssh-key-action@v2 | |
with: | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
known_hosts: ${{ secrets.KNOWN_HOSTS }} | |
- name: Clone AUR and update | |
run: | | |
git clone ssh://[email protected]/uoj-data-converter-git.git ../aur | |
shopt -s dotglob | |
shopt -s extglob | |
rm ../aur/!(.git|.|..) || true | |
cp aur/git/* ../aur | |
cd ../aur | |
git config user.name "Yufan You" | |
git config user.email "[email protected]" | |
git add -A | |
git diff-index @ --exit-code --quiet || git commit -m "Update from GitHub Actions: ${{ steps.get-version.outputs.version }} | |
https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}" | |
git push |