macos-release.yml 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. name: macOS Release
  2. permissions:
  3. contents: write
  4. on:
  5. push:
  6. tags:
  7. - '*'
  8. - '!*-alpha*'
  9. jobs:
  10. release:
  11. runs-on: macos-latest
  12. steps:
  13. - name: Checkout
  14. uses: actions/checkout@v3
  15. with:
  16. fetch-depth: 0
  17. - uses: actions/setup-node@v3
  18. with:
  19. node-version: 16
  20. - name: Build Frontend
  21. env:
  22. CI: ""
  23. run: |
  24. cd web
  25. npm install
  26. REACT_APP_VERSION=$(git describe --tags) npm run build
  27. cd ..
  28. - name: Set up Go
  29. uses: actions/setup-go@v3
  30. with:
  31. go-version: '>=1.18.0'
  32. - name: Build Backend
  33. run: |
  34. go mod download
  35. go build -ldflags "-X 'one-api/common.Version=$(git describe --tags)'" -o one-api-macos
  36. - name: Release
  37. uses: softprops/action-gh-release@v1
  38. if: startsWith(github.ref, 'refs/tags/')
  39. with:
  40. files: one-api-macos
  41. draft: true
  42. generate_release_notes: true
  43. env:
  44. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}