-
Notifications
You must be signed in to change notification settings - Fork 0
165 lines (143 loc) · 4.67 KB
/
deploy.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
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
name: CD
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"
workflow_dispatch:
permissions:
contents: write
jobs:
check_tags:
runs-on: ubuntu-latest
steps:
- name: Version Increment
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
uses: reecetech/[email protected]
with:
scheme: semver
increment: patch
build:
needs: check_tags
name: Build platform libs
runs-on: ubuntu-latest
strategy:
matrix:
# You can add more, for any target you'd like!
include:
# Debug linux
- target: x86_64-unknown-linux-gnu
artifact: libsqore.so
type: debug
# Debug mac
- target: x86_64-apple-darwin
artifact: libsqore.dylib
type: debug
# Debug Windows
- target: x86_64-pc-windows-gnu
artifact: sqore.dll
type: debug
# Release linux
- target: x86_64-unknown-linux-gnu
artifact: libsqore.so
type: release
# Release mac
- target: x86_64-apple-darwin
artifact: libsqore.dylib
type: release
# Release windows
- target: x86_64-pc-windows-gnu
artifact: sqore.dll
type: release
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get the release version from the tag
shell: bash
run: echo "VERSION=$\{GITHUB_REF#refs/tags/\}" >> $GITHUB_ENV
- name: Install Rust
# Or @nightly if you want
uses: dtolnay/rust-toolchain@stable
# Arguments to pass in
with:
# Make Rust compile to our target (defined in the matrix)
targets: ${{ matrix.target }}
- name: Build Release
uses: actions-rs/cargo@v1
if: matrix.type == 'release' # gotta be a better way?
with:
use-cross: true
command: build
args: --verbose --release --target ${{ matrix.target }}
- name: Build Debug
uses: actions-rs/cargo@v1
if: matrix.type == 'debug'
with:
use-cross: true
command: build
args: --verbose --target ${{ matrix.target }}
- name: Upload lib
uses: actions/[email protected]
with:
name: ${{ matrix.artifact }}--${{ matrix.type }}
if-no-files-found: error
path: "target/${{ matrix.target }}/${{matrix.type}}/${{ matrix.artifact }}"
overwrite: true
package:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: start package
run: |
mkdir addons
mkdir addons/sqore
mkdir addons/sqore/target
mkdir addons/sqore/target/debug
mkdir addons/sqore/target/release
mkdir libs
mkdir libs/debug
mkdir libs/release
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Build docs
uses: actions-rs/cargo@v1
with:
use-cross: false
command: doc
args: --verbose --no-deps --target-dir .
- name: download debug files
uses: actions/[email protected]
with:
# Destination path. Supports basic tilde expansion. Defaults to $GITHUB_WORKSPACE
path: "libs/debug/"
# A glob pattern matching the artifacts that should be downloaded. Ignored if name is specified.
pattern: "*sqore*--debug"
- name: download release files
uses: actions/[email protected]
with:
# Destination path. Supports basic tilde expansion. Defaults to $GITHUB_WORKSPACE
path: "libs/release/"
# A glob pattern matching the artifacts that should be downloaded. Ignored if name is specified.
pattern: "*sqore*--release"
- name: move files
run: |
for d in $(ls libs/debug/**/*sqore*);
do cp $d addons/sqore/target/debug/
done;
for r in $(ls libs/release/**/*sqore*);
do cp $r addons/sqore/target/release/
done;
cp README.md addons/sqore/README.md
cp LICENSE addons/sqore/LICENSE
cp sqore.gdextension addons/sqore/sqore.gdextension
cp -r scenes addons/sqore/scenes/
cp -r assets addons/sqore/assets/
cp -r doc addons/sqore/doc/
zip -r -q sqore_release addons
ls -1
- name: Make Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: sqore_release.zip