2
0

publish.yml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. name: publish
  2. on:
  3. workflow_dispatch:
  4. push:
  5. branches:
  6. - dev
  7. tags:
  8. - "*"
  9. - "!vscode-v*"
  10. - "!github-v*"
  11. concurrency: ${{ github.workflow }}-${{ github.ref }}
  12. permissions:
  13. contents: write
  14. packages: write
  15. jobs:
  16. publish:
  17. runs-on: ubuntu-latest
  18. steps:
  19. - uses: actions/checkout@v3
  20. with:
  21. fetch-depth: 0
  22. - run: git fetch --force --tags
  23. - uses: actions/setup-go@v5
  24. with:
  25. go-version: ">=1.24.0"
  26. cache: true
  27. cache-dependency-path: go.sum
  28. - uses: oven-sh/setup-bun@v2
  29. with:
  30. bun-version: 1.2.17
  31. - name: Install makepkg
  32. run: |
  33. sudo apt-get update
  34. sudo apt-get install -y pacman-package-manager
  35. - name: Setup SSH for AUR
  36. run: |
  37. mkdir -p ~/.ssh
  38. echo "${{ secrets.AUR_KEY }}" > ~/.ssh/id_rsa
  39. chmod 600 ~/.ssh/id_rsa
  40. ssh-keyscan -H aur.archlinux.org >> ~/.ssh/known_hosts
  41. git config --global user.email "[email protected]"
  42. git config --global user.name "opencode"
  43. - name: Publish
  44. run: |
  45. bun install
  46. if [ "${{ startsWith(github.ref, 'refs/tags/') }}" = "true" ]; then
  47. ./script/publish.ts
  48. else
  49. ./script/publish.ts --snapshot
  50. fi
  51. working-directory: ./packages/opencode
  52. env:
  53. GITHUB_TOKEN: ${{ secrets.SST_GITHUB_TOKEN }}
  54. AUR_KEY: ${{ secrets.AUR_KEY }}
  55. NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }}