-
Notifications
You must be signed in to change notification settings - Fork 1
78 lines (64 loc) · 2.03 KB
/
publish.yml
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
name: Publish
on:
release:
types: [published]
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
publish:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-24.04, macos-15]
steps:
- uses: actions/checkout@v4
- name: Setup mac dependencies
if: matrix.os == 'macos-15'
run: |
# Create directory for Macport installs
sudo mkdir -p /opt/local
# Conigure permissions on that directory
sudo chmod -R 777 /opt/local
# Add the path to GITHUB_PATH
echo "/opt/local/bin:/opt/local/sbin" >> "$GITHUB_PATH"
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
cli/libpff-20231205
/opt/local
key: ${{ runner.os }}-build-${{ hashFiles('**/Cargo.lock', 'scripts/build-install') }}
- name: Install build deps
run: ./scripts/build-install
env:
BUILD_PLATFORM: ${{ matrix.os }}
- name: Build
run: ./scripts/build
- name: Run tests
run: ./scripts/check
env:
REINFER_CLI_TEST_PROJECT: ${{ secrets.REINFER_CLI_TEST_PROJECT }}
REINFER_CLI_TEST_TOKEN: ${{ secrets.REINFER_CLI_TEST_TOKEN }}
REINFER_CLI_TEST_ENDPOINT: ${{ secrets.REINFER_CLI_TEST_ENDPOINT }}
- name: Install publish dependencies
run: ./scripts/publish-install
env:
BUILD_PLATFORM: ${{ matrix.os }}
- name: GCP Auth
uses: google-github-actions/auth@v1
with:
credentials_json: ${{ secrets.GCP_CREDENTIALS }}
- uses: google-github-actions/setup-gcloud@v1
name: Set up Cloud SDK
- name: Publish Binaries
run: ./cli/publish-binaries
env:
BUILD_PLATFORM: ${{ matrix.os }}
- name: Publish Crates
if: ${{ matrix.os == 'ubuntu-24.04' }}
run: |
cargo login ${{ secrets.CRATES_IO_TOKEN }}
./scripts/publish