publish.yml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. name: publish
  2. run-name: "${{ format('v{0}', inputs.version) }}"
  3. on:
  4. workflow_dispatch:
  5. inputs:
  6. version:
  7. description: "Version to publish"
  8. required: true
  9. type: string
  10. title:
  11. description: "Custom title for this run"
  12. required: false
  13. type: string
  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: oven-sh/setup-bun@v2
  32. with:
  33. bun-version: 1.2.19
  34. - name: Install makepkg
  35. run: |
  36. sudo apt-get update
  37. sudo apt-get install -y pacman-package-manager
  38. - name: Setup SSH for AUR
  39. run: |
  40. mkdir -p ~/.ssh
  41. echo "${{ secrets.AUR_KEY }}" > ~/.ssh/id_rsa
  42. chmod 600 ~/.ssh/id_rsa
  43. ssh-keyscan -H aur.archlinux.org >> ~/.ssh/known_hosts
  44. git config --global user.email "[email protected]"
  45. git config --global user.name "opencode"
  46. - name: Publish
  47. run: |
  48. bun install
  49. OPENCODE_VERSION=${{ inputs.version }} ./script/publish.ts
  50. env:
  51. GITHUB_TOKEN: ${{ secrets.SST_GITHUB_TOKEN }}
  52. AUR_KEY: ${{ secrets.AUR_KEY }}
  53. NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }}