forked from Brendonovich/prisma-client-rust
-
Notifications
You must be signed in to change notification settings - Fork 1
141 lines (117 loc) · 4.02 KB
/
release.yaml
File metadata and controls
141 lines (117 loc) · 4.02 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: Release Binaries
on:
workflow_dispatch:
inputs:
tag:
description: 'Release tag to build binaries for (e.g., v0.6.11.2)'
required: true
type: string
env:
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
RUST_BACKTRACE: short
RUSTUP_MAX_RETRIES: 10
jobs:
build-macos:
name: Build aarch64-apple-darwin
runs-on: namespace-profile-gitar-macos
steps:
- name: Checkout repository
uses: namespacelabs/nscloud-checkout-action@v8
with:
ref: ${{ inputs.tag }}
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache Dependencies
uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build --release --package prisma-cli
- name: Create zip
run: |
cd target/release
mv prisma prisma-cli-aarch64-apple-darwin
zip prisma-cli-aarch64-apple-darwin.zip prisma-cli-aarch64-apple-darwin
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: prisma-cli-aarch64-apple-darwin
path: target/release/prisma-cli-aarch64-apple-darwin.zip
build-linux-x86:
name: Build x86_64-unknown-linux-gnu
runs-on: namespace-profile-gitar
steps:
- name: Checkout repository
uses: namespacelabs/nscloud-checkout-action@v8
with:
ref: ${{ inputs.tag }}
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache Dependencies
uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build --release --package prisma-cli
- name: Create zip
run: |
cd target/release
mv prisma prisma-cli-x86_64-unknown-linux-gnu
zip prisma-cli-x86_64-unknown-linux-gnu.zip prisma-cli-x86_64-unknown-linux-gnu
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: prisma-cli-x86_64-unknown-linux-gnu
path: target/release/prisma-cli-x86_64-unknown-linux-gnu.zip
build-linux-arm:
name: Build aarch64-unknown-linux-gnu
runs-on: namespace-profile-gitar
steps:
- name: Checkout repository
uses: namespacelabs/nscloud-checkout-action@v8
with:
ref: ${{ inputs.tag }}
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-unknown-linux-gnu
- name: Install Zig
uses: goto-bus-stop/setup-zig@v2
with:
version: 0.13.0
- name: Install cargo-zigbuild
run: cargo install cargo-zigbuild
- name: Cache Dependencies
uses: Swatinem/rust-cache@v2
with:
key: aarch64-unknown-linux-gnu
- name: Build with zigbuild
run: cargo zigbuild --release --package prisma-cli --target aarch64-unknown-linux-gnu
- name: Create zip
run: |
cd target/aarch64-unknown-linux-gnu/release
mv prisma prisma-cli-aarch64-unknown-linux-gnu
zip prisma-cli-aarch64-unknown-linux-gnu.zip prisma-cli-aarch64-unknown-linux-gnu
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: prisma-cli-aarch64-unknown-linux-gnu
path: target/aarch64-unknown-linux-gnu/release/prisma-cli-aarch64-unknown-linux-gnu.zip
upload-release:
name: Upload to Release
needs: [build-macos, build-linux-x86, build-linux-arm]
runs-on: namespace-profile-gitar-small
permissions:
contents: write
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Display structure of downloaded files
run: find artifacts -type f -name "*.zip"
- name: Upload release assets
env:
GH_TOKEN: ${{ github.token }}
run: |
for zip in $(find artifacts -type f -name "*.zip"); do
echo "Uploading $zip"
gh release upload ${{ inputs.tag }} "$zip" --repo ${{ github.repository }} --clobber
done