-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (88 loc) · 2.81 KB
/
build-opensta.yml
File metadata and controls
98 lines (88 loc) · 2.81 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
name: Build OpenSTA
on:
push:
paths:
- ".github/workflows/build-opensta.yml"
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
jobs:
check:
outputs:
sha: ${{ steps.sha.outputs.sha }}
release-exists: ${{ steps.release.outputs.release-exists }}
runs-on: ubuntu-latest
steps:
- name: Gather SHA
id: sha
run: |
commit_sha=$(curl -s "https://api.github.com/repos/parallaxsw/OpenSTA/commits" | jq -r '.[0].sha')
if [ -z "$commit_sha" ]; then
exit 1
fi
echo "sha=$(echo $commit_sha | cut -c1-7)" >> "$GITHUB_OUTPUT"
- name: Check if release exists
id: release
run: |
response=$(curl -s -o /dev/null -w "%{http_code}" "https://api.github.com/repos/oscc-ip/artifact/releases/tags/${{ steps.sha.outputs.sha }}")
if [ "$response" -eq 200 ]; then
echo "release-exists=true" >> "$GITHUB_OUTPUT"
else
echo "release-exists=false" >> "$GITHUB_OUTPUT"
fi
build:
runs-on: ubuntu-latest
needs: check
if: needs.check.outputs.release-exists == 'false'
permissions:
contents: write
id-token: write
attestations: write
steps:
- name: Checkout
uses: actions/checkout@v6
with:
repository: parallaxsw/OpenSTA
submodules: true
- name: Set up dependencies
run: |
sudo apt-get update && sudo apt-get install -y flex libfl-dev bison tcl-dev tcl-tclreadline libeigen3-dev ninja-build
- name: Set up cudd-3.0.0
run: |
wget https://github.com/oscc-ip/artifact/releases/download/cudd-3.0.0/build.tar.gz
mkdir -p cudd
tar -zxvf build.tar.gz -Ccudd
- name: Build OpenSTA
run: |
mkdir build
cd build
cmake .. -G Ninja -DCUDD_DIR=$(pwd)/../cudd -DCMAKE_INSTALL_PREFIX=$(pwd)/install -DCMAKE_BUILD_TYPE=Release
cmake --build . --target all -- -j $(nproc)
cmake --install .
tar -zcvf build.tar.gz -Cinstall .
cd ..
- name: Upload Artifacts
uses: actions/upload-artifact@v7
with:
path: |
build/install/*
- name: Publish Release
id: publish
uses: softprops/action-gh-release@v2
with:
fail_on_unmatched_files: true
name: OpenSTA-${{ needs.check.outputs.sha }}
tag_name: ${{ needs.check.outputs.sha }}
make_latest: true
files: |
build/build.tar.gz
build/install/bin/*
body: |
OpenSTA release
- name: Attest Release Files
id: attest
uses: actions/attest-build-provenance@v4
with:
subject-path: |
build/build.tar.gz
build/install/bin/*