-
Notifications
You must be signed in to change notification settings - Fork 0
/
c-cpp.yml
81 lines (78 loc) · 2.42 KB
/
c-cpp.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
name: Build VCV Rack Plugin
on: [push, pull_request]
env:
rack-sdk-version: 2.git.042a9ce0-win
release-tag: AzureCI
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
matrix:
config:
- {
name: Windows,
os: windows-latest,
prepare-os: export CC=gcc
}
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Get RackSDK
shell: bash
run: |
pushd $HOME
curl -o RackSDK.zip https://vcvrack.com/downloads/Rack-SDK-${{ env.rack-sdk-version }}.zip
unzip RackSDK.zip
- name: Patch plugin.mk, use 7zip on Windows
shell: bash
if: runner.os == 'Windows'
run: |
sed -i 's/zip -q -9 -r/7z a -tzip -mx=9/' $HOME/Rack-SDK/plugin.mk
- name: Modify plugin version
shell: bash
run: |
gitrev=`git rev-parse --short HEAD`
pluginversion=`jq -r '.version' plugin.json`
echo "Set plugin version from $pluginversion to $pluginversion-$gitrev"
cat <<< `jq --arg VERSION "$pluginversion-$gitrev" '.version=$VERSION' plugin.json` > plugin.json
- name: Build plugin
shell: bash
run: |
${{ matrix.config.prepare-os }}
export RACK_DIR=$HOME/Rack-SDK
make -j dep
make -j dist
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
path: dist
name: ${{ matrix.config.name }}
publish:
name: Publish
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/New-Development'
steps:
- uses: actions/download-artifact@v2
- name: Tag asset names with date
run: |
mv **/*.zip .
export EXTEND_TAG=`date "+%Y%m%d"`
for file in ./*.zip; do mv "$file" "${file/.zip/-${EXTEND_TAG}.zip}"; done
- name: Delete existing release assets
uses: mknejp/delete-release-assets@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ env.release-tag }}
assets: '*.zip'
fail-if-no-assets: false
- name: Upload release assets
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: "*.zip"
tag: ${{ env.release-tag }}
overwrite: true
file_glob: true