publish.yml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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: Cache ~/.bun
  35. id: cache-bun
  36. uses: actions/cache@v3
  37. with:
  38. path: ~/.bun
  39. key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock') }}
  40. restore-keys: |
  41. ${{ runner.os }}-bun-
  42. - name: Install makepkg
  43. run: |
  44. sudo apt-get update
  45. sudo apt-get install -y pacman-package-manager
  46. - name: Setup SSH for AUR
  47. run: |
  48. mkdir -p ~/.ssh
  49. echo "${{ secrets.AUR_KEY }}" > ~/.ssh/id_rsa
  50. chmod 600 ~/.ssh/id_rsa
  51. git config --global user.email "[email protected]"
  52. git config --global user.name "opencode"
  53. ssh-keyscan -H aur.archlinux.org >> ~/.ssh/known_hosts || true
  54. - name: Install dependencies
  55. run: bun install
  56. - name: Publish
  57. run: |
  58. OPENCODE_VERSION=${{ inputs.version }} ./script/publish.ts
  59. env:
  60. GITHUB_TOKEN: ${{ secrets.SST_GITHUB_TOKEN }}
  61. AUR_KEY: ${{ secrets.AUR_KEY }}
  62. NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }}