Repository navigation
185 lines (158 loc) · 5.69 KB
/
Copy pathrelease-rust.yml
File metadata and controls
185 lines (158 loc) · 5.69 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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
name: "Rust (release)"
on:
workflow_call:
workflow_dispatch:
inputs:
packageVersion:
description: 'Version to build'
required: true
default: ''
jobs:
homebrew:
name: Package Source
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: trinsic-id/set-version@v0.1
id: setversion
with:
githubToken: ${{ secrets.API_GITHUB_TOKEN }}
overrideVersion: ${{ github.event.inputs.packageVersion }}
- name: Create Archive
run: |
cp -r include native
sed -i 's/version = "0.1.0"/version = "${{ steps.setversion.outputs.packageVersion }}"/g' native/Cargo.toml
mv native okapi
tar -czvf okapi-${{ steps.setversion.outputs.packageVersion }}.tar.gz okapi
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: archive
path: |
./*.tar.gz
- name: Upload to Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./okapi-${{ steps.setversion.outputs.packageVersion }}.tar.gz
asset_name: okapi-${{ steps.setversion.outputs.packageVersion }}.tar.gz
tag: ${{ steps.setversion.outputs.releaseVersion }}
overwrite: false
body: "Okapi Library Source"
deb:
name: Debian Package
runs-on: ubuntu-latest
# strategy:
# matrix:
# arch: [amd64]
# include:
# - arch: x86_64
# target: x86_64-unknown-linux-gnu
# image: macos-latest
# - arch: amd64
# target: aarch64-unknown-linux-gnu
# image: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: trinsic-id/set-version@v0.1
id: setversion
with:
githubToken: ${{ secrets.API_GITHUB_TOKEN }}
overrideVersion: ${{ github.event.inputs.packageVersion }}
- name: Create Package (.deb)
run: |
cargo install cargo-deb
sed -i 's/version = "0.1.0"/version = "${{ steps.setversion.outputs.packageVersion }}"/g' Cargo.toml
cargo deb
working-directory: native
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: deb
path: |
./native/target/**/*.deb
- name: Upload to Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./native/target/debian/okapi_${{ steps.setversion.outputs.packageVersion }}_amd64.deb
asset_name: okapi_${{ steps.setversion.outputs.packageVersion }}_amd64.deb
tag: ${{ steps.setversion.outputs.releaseVersion }}
overwrite: false
body: "Okapi Debian Package"
nix:
name: NixOS Package
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: trinsic-id/set-version@v0.1
id: setversion
with:
githubToken: ${{ secrets.API_GITHUB_TOKEN }}
overrideVersion: ${{ github.event.inputs.packageVersion }}
- name: Create Vendored Folders
run: |
export CARGO_HOME=`pwd`
cp -r include native
cd native
sed -i 's/version = "0.1.0"/version = "${{ steps.setversion.outputs.packageVersion }}"/g' Cargo.toml
mv .cargo/_config.toml .cargo/config.toml
rm .cargo/config
cargo vendor
cargo build
cargo clean
- name: Create Archive
run: |
mv native okapi
tar -czvf okapi-vendor-${{ steps.setversion.outputs.packageVersion }}.tar.gz okapi
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: nix
path: |
./*.tar.gz
- name: Upload to Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./okapi-vendor-${{ steps.setversion.outputs.packageVersion }}.tar.gz
asset_name: okapi-vendor-${{ steps.setversion.outputs.packageVersion }}.tar.gz
tag: ${{ steps.setversion.outputs.releaseVersion }}
overwrite: false
body: "okapi bundle for Nix"
windows:
name: WIX Package
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: trinsic-id/set-version@v0.1
id: setversion
with:
githubToken: ${{ secrets.API_GITHUB_TOKEN }}
overrideVersion: ${{ github.event.inputs.packageVersion }}
- name: Create wix installer
run: |
([Regex]'version = "0.1.0"').Replace((Get-Content -path Cargo.toml -Raw), 'version = "${{ steps.setversion.outputs.packageVersion }}"', 1) | Set-Content -Path Cargo.toml
cargo install cargo-wix
cargo wix -b "C:\Program Files (x86)\WiX Toolset v3.11\bin"
shell: pwsh
working-directory: native
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: wix
path: |
./native/target/wix/okapi-${{ steps.setversion.outputs.packageVersion }}-x86_64.msi
- name: Upload to Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./native/target/wix/okapi-${{ steps.setversion.outputs.packageVersion }}-x86_64.msi
asset_name: okapi-${{ steps.setversion.outputs.packageVersion }}-x86_64.msi
tag: ${{ steps.setversion.outputs.releaseVersion }}
overwrite: false
body: "okapi bundle for windows installer"