publish.yml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. name: publish
  2. on:
  3. workflow_dispatch:
  4. push:
  5. branches:
  6. - dontlook
  7. tags:
  8. - "*"
  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.16
  29. - name: Setup SSH for AUR
  30. run: |
  31. mkdir -p ~/.ssh
  32. echo "${{ secrets.AUR_KEY }}" > ~/.ssh/id_rsa
  33. chmod 600 ~/.ssh/id_rsa
  34. - name: Publish
  35. run: |
  36. bun install
  37. if [ "${{ startsWith(github.ref, 'refs/tags/') }}" = "true" ]; then
  38. ./script/publish.ts
  39. else
  40. ./script/publish.ts --snapshot
  41. fi
  42. working-directory: ./packages/opencode
  43. env:
  44. GITHUB_TOKEN: ${{ secrets.SST_GITHUB_TOKEN }}
  45. AUR_KEY: ${{ secrets.AUR_KEY }}
  46. NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }}