Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build
name: release

on:
workflow_dispatch:
Expand Down Expand Up @@ -659,7 +659,7 @@ jobs:
cleanup-snapshot-tag:
needs:
- build-electron
if: ${{ inputs.phase == 'finalize' && needs.build-electron.result == 'success' }}
if: ${{ always() && inputs.phase == 'finalize' && needs.build-electron.result == 'success' }}
runs-on: ubuntu-latest
permissions:
contents: write
Expand Down
8 changes: 6 additions & 2 deletions packages/opencode/test/github/build-workflow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ import { parseWorkflow, readWorkflow } from "./workflow-parser"
const repoRoot = path.join(import.meta.dir, "../../../..")
const workflowPath = path.join(repoRoot, ".github", "workflows", "build.yml")

describe("build workflow", () => {
describe("release workflow", () => {
test("pins upgraded checkout and upload-artifact refs in the release workflow", () => {
Comment thread
Astro-Han marked this conversation as resolved.
Resolved
const workflow = readWorkflow(workflowPath)
const parsed = parseWorkflow(workflowPath)
const buildElectron = parsed.jobs?.["build-electron"]
const cleanupSnapshotTag = parsed.jobs?.["cleanup-snapshot-tag"]
const steps = buildElectron?.steps ?? []
const checkoutSteps = steps.filter(
(step) => step.uses === "actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd",
Expand All @@ -22,13 +23,16 @@ describe("build workflow", () => {
)
const signedArtifactStep = steps.find((step) => step.name === "Upload signed app artifact")

expect(parsed.name).toBe("build")
expect(parsed.name).toBe("release")
expect(parsed.permissions).toEqual({
actions: "read",
contents: "write",
})
expect(parsed.on?.workflow_dispatch).toBeDefined()
expect(buildElectron?.["runs-on"]).toBe("${{ matrix.host }}")
expect(cleanupSnapshotTag?.if).toBe(
"${{ always() && inputs.phase == 'finalize' && needs.build-electron.result == 'success' }}",
)
Comment thread
Astro-Han marked this conversation as resolved.
Resolved
expect(checkoutSteps).toHaveLength(2)
expect(checkoutSteps[0]?.with).toEqual({ "persist-credentials": false })
expect(checkoutSteps[1]?.with).toEqual({
Expand Down
Loading