-
Notifications
You must be signed in to change notification settings - Fork 1
65 lines (51 loc) · 1.54 KB
/
macos.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
name: macOS
on:
push:
branches: [main, "v[0-9]+.[0-9]+.[0-9]+"]
pull_request:
branches: [main, "v[0-9]+.[0-9]+.[0-9]+"]
release:
types:
- created
env:
CARGO_TERM_COLOR: always
jobs:
test:
runs-on: macos-latest
steps:
- uses: actions/[email protected]
- name: Install fmt and clippy
run: |
rustup component add rustfmt
rustup component add clippy
- name: Run fmt
run: cargo fmt -- --check
- name: Run clippy
run: cargo clippy -- -D warnings
- name: Build
run: cargo build --tests --verbose
- name: Run tests
run: cargo test --verbose
deploy:
needs: test
if: ${{ github.event_name == 'release' }}
runs-on: macos-latest
steps:
- uses: actions/[email protected]
- id: "auth"
uses: google-github-actions/[email protected]
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
credentials_json: ${{ secrets.GCP_SA_KEY }}
- name: "Set up Cloud SDK"
uses: google-github-actions/[email protected]
- name: Cargo build
run: cargo build -p tmc --release --verbose
- name: Sign
run: codesign --force -s - target/release/tmc
- name: Get the version
id: get_version
shell: bash
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
- name: Deploy
run: gsutil cp target/release/tmc gs://${{ secrets.GCP_BUCKET }}/tmc-cli-rust/tmc-cli-rust-x86_64-apple-darwin-${{ steps.get_version.outputs.VERSION }}