Repository navigation
90 lines (85 loc) · 2.95 KB
/
Copy pathcli-release.yml
File metadata and controls
90 lines (85 loc) · 2.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Release OCC CLI
on:
workflow_dispatch:
inputs:
source_sha:
description: Full main source SHA and selected workflow revision
required: true
type: string
ci_run_id:
description: Successful main-push CI run for exactly source_sha
required: true
type: string
permissions:
contents: read
env:
SOURCE_SHA: ${{ inputs.source_sha }}
CI_RUN_ID: ${{ inputs.ci_run_id }}
jobs:
prepare:
name: Build versioned OCC CLI binaries
runs-on: ubuntu-24.04
timeout-minutes: 15
permissions:
actions: read
contents: read
outputs:
version: ${{ steps.gate.outputs.version }}
ci_attempt: ${{ steps.gate.outputs.ci_attempt }}
artifact_name: ${{ steps.package.outputs.artifact_name }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
ref: ${{ github.workflow_sha }}
persist-credentials: false
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1
with:
node-version: "24.22.1"
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version: "1.27.3"
- name: Require the exact main source and successful CI
id: gate
env:
GH_TOKEN: ${{ github.token }}
run: node scripts/ci/cli-release.ts validate
- name: Cross-compile and verify four CLI binaries
id: package
run: |
node scripts/ci/cli-release.ts package "$RUNNER_TEMP/occ-cli"
echo "artifact_name=occ-cli-${{ github.run_id }}-${{ github.run_attempt }}" >> "$GITHUB_OUTPUT"
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: ${{ steps.package.outputs.artifact_name }}
path: ${{ runner.temp }}/occ-cli/
if-no-files-found: error
retention-days: 30
publish:
name: Publish verified CLI assets as a GitHub Release
needs: prepare
runs-on: ubuntu-24.04
timeout-minutes: 15
environment: container-publish
concurrency:
group: enterprise-container-publish
cancel-in-progress: false
permissions:
actions: read
contents: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
ref: ${{ github.workflow_sha }}
persist-credentials: false
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1
with:
node-version: "24.22.1"
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: ${{ needs.prepare.outputs.artifact_name }}
path: ${{ runner.temp }}/occ-cli
- name: Revalidate source and publish exact prepared bytes
env:
GH_TOKEN: ${{ github.token }}
CI_ATTEMPT: ${{ needs.prepare.outputs.ci_attempt }}
run: node scripts/ci/cli-release.ts publish "$RUNNER_TEMP/occ-cli"