publish.yml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. name: publish
  2. on:
  3. workflow_dispatch:
  4. inputs:
  5. version:
  6. description: "Version to publish"
  7. required: true
  8. type: string
  9. concurrency: ${{ github.workflow }}-${{ github.ref }}
  10. permissions:
  11. contents: write
  12. packages: write
  13. jobs:
  14. publish:
  15. runs-on: ubuntu-latest
  16. steps:
  17. - uses: actions/checkout@v3
  18. with:
  19. fetch-depth: 0
  20. - run: git fetch --force --tags
  21. - uses: actions/setup-go@v5
  22. with:
  23. go-version: ">=1.24.0"
  24. cache: true
  25. cache-dependency-path: go.sum
  26. - uses: oven-sh/setup-bun@v2
  27. with:
  28. bun-version: 1.2.17
  29. - name: Install makepkg
  30. run: |
  31. sudo apt-get update
  32. sudo apt-get install -y pacman-package-manager
  33. - name: Setup SSH for AUR
  34. run: |
  35. mkdir -p ~/.ssh
  36. echo "${{ secrets.AUR_KEY }}" > ~/.ssh/id_rsa
  37. chmod 600 ~/.ssh/id_rsa
  38. ssh-keyscan -H aur.archlinux.org >> ~/.ssh/known_hosts
  39. git config --global user.email "opencode@sst.dev"
  40. git config --global user.name "opencode"
  41. - name: Publish
  42. run: |
  43. bun install
  44. OPENCODE_VERSION=${{ inputs.version }} ./script/publish.ts
  45. env:
  46. GITHUB_TOKEN: ${{ secrets.SST_GITHUB_TOKEN }}
  47. AUR_KEY: ${{ secrets.AUR_KEY }}
  48. NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }}