prerelease-workflow.spec.mjs 1.2 KB

1234567891011121314151617181920212223242526272829
  1. import { readFileSync } from "node:fs"
  2. import { describe, expect, it } from "vitest"
  3. const workflow = readFileSync(".github/workflows/prerelease.yml", "utf8")
  4. const official = readFileSync(".github/workflows/build.yml", "utf8")
  5. describe("Windows prerelease workflow", () => {
  6. it("only runs on the prerelease branch or manual dispatch", () => {
  7. expect(workflow).toMatch(/branches:\s*\n\s+- prerelease/)
  8. expect(workflow).toContain("workflow_dispatch:")
  9. expect(workflow).not.toMatch(/tags:\s*\n\s+- ["']v\*/)
  10. })
  11. it("builds Windows only", () => {
  12. expect(workflow).toContain("runs-on: windows-latest")
  13. expect(workflow).toContain("--bundles nsis")
  14. expect(workflow).not.toMatch(/macos-latest|macos-15-intel|ubuntu-22\.04/)
  15. expect(workflow).not.toMatch(/--bundles dmg|--bundles deb/)
  16. })
  17. it("publishes a GitHub prerelease without touching the stable updater channel", () => {
  18. expect(workflow).toContain("--prerelease")
  19. expect(workflow).toContain("--latest=false")
  20. expect(workflow).toContain('tag="prerelease"')
  21. expect(workflow).toContain("QMaiWrite_*_prerelease.exe")
  22. expect(workflow).not.toMatch(/gh release (create|upload)[\s\S]*latest\.json/)
  23. expect(official).toMatch(/gh release upload[\s\S]*latestPath/)
  24. })
  25. })