-
Notifications
You must be signed in to change notification settings - Fork 10
79 lines (64 loc) · 2.06 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
name: deploy
on:
push:
tags:
- "v*.*.*"
jobs:
create-binaries:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Install nasm
run: |
$NASM_VERSION="2.15.05"
$LINK="https://www.nasm.us/pub/nasm/releasebuilds/$NASM_VERSION/win64"
curl -LO "$LINK/nasm-$NASM_VERSION-win64.zip"
7z e -y "nasm-$NASM_VERSION-win64.zip" -o"C:\nasm"
echo "C:\nasm" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable-x86_64-pc-windows-gnu
override: true
- name: Build
run: |
cargo build --release
- name: Create zip
run: |
$METRICS_PATH="$Env:GITHUB_WORKSPACE\target\release"
7z a av-scenechange.zip `
"$METRICS_PATH\av-scenechange.exe"
- name: Upload binaries
uses: actions/upload-artifact@v2
with:
name: av-scenechange-bins
path: av-scenechange.zip
deploy:
needs: create-binaries
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Download the zip
uses: actions/download-artifact@v2
- name: Unzip av-scenechange Windows binaries
run: |
unzip av-scenechange-bins/av-scenechange.zip -d av-scenechange-bins
- name: Handle release data and files
id: data
run: |
VERSION=$(head -n 1 CHANGELOG.md | tr -d "## Version ")
echo "::set-output name=version::$VERSION"
tail -n +2 CHANGELOG.md | sed -e '/^$/,$d' > CHANGELOG.txt
cd av-scenechange-bins
strip av-scenechange.exe
mv av-scenechange.exe ..
- name: Create a release
uses: softprops/action-gh-release@v1
with:
name: Version ${{ steps.data.outputs.version }}
body_path: CHANGELOG.txt
files: |
av-scenechange.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}