-
Notifications
You must be signed in to change notification settings - Fork 3
66 lines (59 loc) · 2.05 KB
/
build.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
name: Build and Release
on:
push:
branches:
- main
pull_request:
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Install dependencies and build
run: |
set -ex
# A newer FreePascal compiler is needed than what ships with Ubuntu 20.04
wget -q "https://downloads.sourceforge.net/project/freepascal/Linux/3.2.2/fpc-3.2.2.x86_64-linux.tar"
tar xfv fpc-3.2.2.x86_64-linux.tar
cd fpc-*-linux
echo -e '/usr\nN\nN\nN\n' | sudo bash ./install.sh
cd ..
mkdir -p lib/x86_64-linux/ bin/Linux/
bash -ex compile.sh
cd Test_files
find *.sh -exec bash -ex {} \;
mkdir -p ../output ; rm -rf ../output/* || true
cp -r * ../output/
find ../output/ -type f -not -name '*.ini' -delete
( cd ../output/ ; zip -r ../performances.zip * )
cd ..
shell: bash
- name: Upload binary to artifacts
uses: actions/upload-artifact@v2
with:
name: mdx_perfconv
path: |
bin/Linux/MDX_PerfConv
performances.zip
- name: Cleanup Old Releases
if: github.ref == 'refs/heads/main'
run: |
old_release_id=$(curl -s -H "Authorization: Bearer ${{secrets.GITHUB_TOKEN}}" "https://api.github.com/repos/${{github.repository}}/releases" | jq -r '.[] | select(.tag_name == "continuous") | .id')
if [[ -n "$old_release_id" ]]; then
echo "Deleting old release..."
curl -X DELETE -H "Authorization: Bearer ${{secrets.GITHUB_TOKEN}}" "https://api.github.com/repos/${{github.repository}}/releases/$old_release_id"
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create or Update Release
if: github.ref == 'refs/heads/main'
id: create_release
uses: softprops/action-gh-release@v1
with:
files: |
bin/Linux/MDX_PerfConv
performances.zip
tag_name: continuous
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}