publish.yml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. name: publish
  2. run-name: "${{ format('release {0}', inputs.bump) }}"
  3. on:
  4. workflow_dispatch:
  5. inputs:
  6. bump:
  7. description: "Bump major, minor, or patch"
  8. required: true
  9. type: choice
  10. options:
  11. - major
  12. - minor
  13. - patch
  14. concurrency: ${{ github.workflow }}-${{ github.ref }}
  15. permissions:
  16. contents: write
  17. packages: write
  18. jobs:
  19. publish:
  20. runs-on: ubuntu-latest
  21. steps:
  22. - uses: actions/checkout@v3
  23. with:
  24. fetch-depth: 0
  25. - run: git fetch --force --tags
  26. - uses: actions/setup-go@v5
  27. with:
  28. go-version: ">=1.24.0"
  29. cache: true
  30. cache-dependency-path: go.sum
  31. - uses: ./.github/actions/setup-bun
  32. - name: Install makepkg
  33. run: |
  34. sudo apt-get update
  35. sudo apt-get install -y pacman-package-manager
  36. - name: Setup SSH for AUR
  37. run: |
  38. mkdir -p ~/.ssh
  39. echo "${{ secrets.AUR_KEY }}" > ~/.ssh/id_rsa
  40. chmod 600 ~/.ssh/id_rsa
  41. git config --global user.email "[email protected]"
  42. git config --global user.name "opencode"
  43. ssh-keyscan -H aur.archlinux.org >> ~/.ssh/known_hosts || true
  44. - name: Install OpenCode
  45. run: curl -fsSL https://opencode.ai/install | bash
  46. - name: Publish
  47. run: |
  48. ./script/publish.ts
  49. env:
  50. OPENCODE_BUMP: ${{ inputs.bump }}
  51. OPENCODE_CHANNEL: latest
  52. GITHUB_TOKEN: ${{ secrets.SST_GITHUB_TOKEN }}
  53. AUR_KEY: ${{ secrets.AUR_KEY }}
  54. NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }}
  55. OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }}