diff options
| author | 2025-05-25 03:01:41 +0800 | |
|---|---|---|
| committer | 2025-05-25 10:48:36 +0800 | |
| commit | 532c5e4d7a178472f608d4790a49fc7bff46e6f1 (patch) | |
| tree | e3c1e1a1ab606d252ffe02b0c0614733d5c0bbc4 /.github | |
| parent | a2d64c304d429705ad68acced34eac53d38b8d5e (diff) | |
| download | soon-532c5e4d7a178472f608d4790a49fc7bff46e6f1.tar.gz soon-532c5e4d7a178472f608d4790a49fc7bff46e6f1.zip | |
feat: Add GitHub Actions workflow for publishing to AUR
Diffstat (limited to '.github')
| -rw-r--r-- | .github/workflows/publish-aur.yml | 54 | ||||
| -rw-r--r-- | .github/workflows/publish-pypi.yml (renamed from .github/workflows/CI.yml) | 8 |
2 files changed, 55 insertions, 7 deletions
diff --git a/.github/workflows/publish-aur.yml b/.github/workflows/publish-aur.yml new file mode 100644 index 0000000..4bfb56d --- /dev/null +++ b/.github/workflows/publish-aur.yml @@ -0,0 +1,54 @@ +name: Publish to AUR +on: + push: + branches: + - main + - master + tags: + - '*' + pull_request: + workflow_dispatch: + +permissions: + contents: read + +jobs: + aur: + name: Publish to AUR when tag starts with v + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/v') + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up SSH for AUR + run: | + mkdir -p ~/.ssh + echo "${{ secrets.AUR_SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519 + chmod 600 ~/.ssh/id_ed25519 + ssh-keyscan -t ed25519 aur.archlinux.org >> ~/.ssh/known_hosts + + - name: Clone AUR repository + run: | + git clone ssh://aur@aur.archlinux.org/soon.git aur-repo + + - name: Update PKGBUILD and .SRCINFO in AUR repo + run: | + cd aur-repo + cp ../PKGBUILD . + makepkg --printsrcinfo > .SRCINFO + git add PKGBUILD .SRCINFO + + if git diff --cached --quiet; then + echo "No changes to commit" + exit 0 + fi + + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + + git commit -m "release: ${{ github.ref_name }}" + git push origin master diff --git a/.github/workflows/CI.yml b/.github/workflows/publish-pypi.yml index 34d6b29..e1ffdc0 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/publish-pypi.yml @@ -1,10 +1,4 @@ -# This file is autogenerated by maturin v1.8.2 -# To update, run -# -# maturin generate-ci github -# -name: CI - +name: Publish to PyPI on: push: branches: |