-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (71 loc) · 2.49 KB
/
Copy pathrelease.yml
File metadata and controls
75 lines (71 loc) · 2.49 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
name: Release Cookie Chain CLI
on:
push:
tags:
- "v*"
workflow_dispatch:
permissions:
contents: write
jobs:
build:
name: Build ${{ matrix.target }}
strategy:
fail-fast: false
matrix:
include:
- os: macos-14
target: aarch64-apple-darwin
- os: ubuntu-24.04
target: x86_64-unknown-linux-gnu
- os: ubuntu-24.04-arm
target: aarch64-unknown-linux-gnu
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install Linux dependencies
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y build-essential clang llvm-dev libclang-dev libudev-dev pkg-config
- name: Install macOS dependencies
if: runner.os == 'macOS'
run: brew install coreutils llvm
- name: Configure Linux LLVM paths
if: runner.os == 'Linux'
run: |
echo "LLVM_CONFIG_PATH=$(command -v llvm-config)" >> "$GITHUB_ENV"
echo "LIBCLANG_PATH=$(llvm-config --libdir)" >> "$GITHUB_ENV"
- name: Configure macOS LLVM paths
if: runner.os == 'macOS'
run: |
LLVM_PREFIX="$(brew --prefix llvm)"
echo "LLVM_CONFIG_PATH=${LLVM_PREFIX}/bin/llvm-config" >> "$GITHUB_ENV"
echo "LIBCLANG_PATH=${LLVM_PREFIX}/lib" >> "$GITHUB_ENV"
echo "CC=$(xcrun -f clang)" >> "$GITHUB_ENV"
echo "CXX=$(xcrun -f clang++)" >> "$GITHUB_ENV"
echo "AR=$(xcrun -f ar)" >> "$GITHUB_ENV"
echo "RANLIB=$(xcrun -f ranlib)" >> "$GITHUB_ENV"
- name: Build release tarball
run: scripts/create-release-tarball.sh --target "${{ matrix.target }}" --channel-or-tag "${{ github.ref_name }}" --tarball-basename cookie-release
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: cookie-release-${{ matrix.target }}
path: |
cookie-release-${{ matrix.target }}.tar.bz2
cookie-release-${{ matrix.target }}.yml
cookie-install-init-${{ matrix.target }}
release:
name: Publish GitHub Release
if: startsWith(github.ref, 'refs/tags/')
needs: build
runs-on: ubuntu-24.04
steps:
- uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- uses: softprops/action-gh-release@v2
with:
files: artifacts/*