publish.yml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 "[email protected]"
  40. git config --global user.name "opencode"
  41. - name: Publish
  42. run: |
  43. bun install
  44. OPENCODE_VERSION=${{ inputs.version }} ./script/publish.ts
  45. working-directory: ./packages/opencode
  46. env:
  47. GITHUB_TOKEN: ${{ secrets.SST_GITHUB_TOKEN }}
  48. AUR_KEY: ${{ secrets.AUR_KEY }}
  49. NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }}