-
Notifications
You must be signed in to change notification settings - Fork 0
110 lines (97 loc) · 2.92 KB
/
Copy pathrelease.yml
File metadata and controls
110 lines (97 loc) · 2.92 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: Build OCR Runtime Cache
on:
workflow_dispatch:
inputs:
tag:
description: Release tag to publish, for example v0.1.0
required: true
default: v0.1.0
push:
tags:
- "v*"
permissions:
contents: write
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: macos-15
name: darwin-arm64
- os: macos-15-intel
name: darwin-x64
- os: ubuntu-24.04
name: linux-x64
- os: windows-2022
name: win32-x64
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install Rust stable
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8
- name: Install Linux build dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake pkg-config
- name: Install macOS build dependencies
if: runner.os == 'macOS'
run: |
if ! command -v cmake >/dev/null 2>&1; then
brew install cmake
fi
cmake --version
- name: Install Windows build dependencies
if: runner.os == 'Windows'
shell: pwsh
run: |
choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System' -y --no-progress
"C:\Program Files\CMake\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
& "C:\Program Files\CMake\bin\cmake.exe" --version
- name: Build and package cache
env:
MSTY_CLAW_OCR_RUNTIME_EXPECTED: ${{ matrix.name }}
run: node scripts/package-runtime.mjs
- name: Upload package artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.name }}
path: |
dist/*.tar.gz
dist/*.zip
dist/*.sha256
release:
needs: build
runs-on: ubuntu-24.04
steps:
- name: Resolve tag
id: tag
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "tag=${{ inputs.tag }}" >> "$GITHUB_OUTPUT"
else
echo "tag=${GITHUB_REF_NAME}" >> "$GITHUB_OUTPUT"
fi
- name: Download package artifacts
uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- name: Publish release
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
TAG: ${{ steps.tag.outputs.tag }}
run: |
if gh release view "$TAG" >/dev/null 2>&1; then
gh release upload "$TAG" dist/* --clobber
else
gh release create "$TAG" dist/* \
--target "$GITHUB_SHA" \
--title "OCR Runtime Cache $TAG" \
--generate-notes
fi