autoupdate.yml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. name: Auto-update packages
  2. on:
  3. schedule: # execute every 24 hours
  4. - cron: "0 */24 * * *"
  5. jobs:
  6. build:
  7. strategy:
  8. matrix:
  9. os: [ubuntu-latest]
  10. runs-on: ${{ matrix.os }}
  11. steps:
  12. - uses: actions/checkout@v1
  13. - uses: xmake-io/github-action-setup-xmake@v1
  14. with:
  15. xmake-version: branch@master
  16. - name: Installation
  17. run: |
  18. curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
  19. echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
  20. sudo apt update
  21. sudo apt install -y gh unzip zip
  22. echo ${{ secrets.XMAKE_REPO_TOKEN }} | gh auth login --with-token
  23. git config --global user.email "[email protected]"
  24. git config --global user.name "ruki"
  25. - name: Install SSH key
  26. uses: shimataro/ssh-key-action@v2
  27. with:
  28. key: ${{ secrets.SSH_KEY }}
  29. name: id_rsa # optional
  30. known_hosts: ${{ secrets.KNOWN_HOSTS }}
  31. - name: Auto-update packages
  32. if: ${{ github.repository }} == "xmake-io/xmake-repo"
  33. run: |
  34. xmake l -vD scripts/autoupdate.lua