macos-release.yml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. name: macOS Release
  2. permissions:
  3. contents: write
  4. on:
  5. workflow_dispatch:
  6. inputs:
  7. name:
  8. description: 'reason'
  9. required: false
  10. push:
  11. tags:
  12. - '*'
  13. - '!*-alpha*'
  14. jobs:
  15. release:
  16. runs-on: macos-latest
  17. steps:
  18. - name: Checkout
  19. uses: actions/checkout@v3
  20. with:
  21. fetch-depth: 0
  22. - uses: oven-sh/setup-bun@v2
  23. with:
  24. bun-version: latest
  25. - name: Build Frontend
  26. env:
  27. CI: ""
  28. NODE_OPTIONS: "--max-old-space-size=4096"
  29. run: |
  30. cd web
  31. bun install
  32. DISABLE_ESLINT_PLUGIN='true' VITE_REACT_APP_VERSION=$(git describe --tags) bun run build
  33. cd ..
  34. - name: Set up Go
  35. uses: actions/setup-go@v3
  36. with:
  37. go-version: '>=1.18.0'
  38. - name: Build Backend
  39. run: |
  40. go mod download
  41. VERSION=$(git describe --tags)
  42. go build -ldflags "-X 'one-api/common.Version=$VERSION'" -o new-api-macos-$VERSION
  43. - name: Release
  44. uses: softprops/action-gh-release@v2
  45. if: startsWith(github.ref, 'refs/tags/')
  46. with:
  47. files: new-api-macos-*
  48. draft: true
  49. generate_release_notes: true
  50. env:
  51. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}