This repository has been archived by the owner on Apr 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (66 loc) · 2.37 KB
/
flow.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: Prebuild Sky130
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
jobs:
prebuild:
name: Prebuild Sky130
runs-on: ubuntu-20.04
steps:
- name: Get Metadata
run: |
echo "OWNER=${{ github.repository_owner }}" >> $GITHUB_ENV
echo "REPO=$(echo ${{ github.repository }} | cut -d/ -f2 | tr -d '\n')" >> $GITHUB_ENV
- name: Checkout OpenLane
uses: actions/checkout@v2
with:
repository: The-OpenROAD-Project/OpenLane
fetch-depth: 0
- name: Get tag name
run: |
SKYWATER_COMMIT=$(python3 ./dependencies/tool.py sky130 -f commit)
OPEN_PDKS_COMMIT=$(python3 ./dependencies/tool.py open_pdks -f commit)
echo "TAG_NAME=$SKYWATER_COMMIT-$OPEN_PDKS_COMMIT" >> $GITHUB_ENV
- name: Check if release exists
run: |
sudo apt-get install -y jq
echo ${{ github.token }} | gh auth login --with-token
echo "EXISTS=$(gh api repos/${{ github.repository }}/releases | jq '.[].tag_name' | grep -c ${{ env.TAG_NAME }} | tr -d '\n')" >> $GITHUB_ENV
- name: Write PDK Root
if: ${{ env.EXISTS == '0' }}
run: |
echo "PDK_ROOT=/usr/local/pdk" >> $GITHUB_ENV
sudo mkdir -p /usr/local/pdk
sudo chown $USER:$USER /usr/local/pdk
- name: Build PDK
if: ${{ env.EXISTS == '0' }}
run: |
make pdk
- name: Compress PDKs
if: ${{ env.EXISTS == '0' }}
run: |
sudo apt-get install -y pv
tar -cf /tmp/sky130A.tar -C /usr/local/pdk/sky130A .
pv /tmp/sky130A.tar | xz > /tmp/sky130A.tar.xz
tar -cf /tmp/sky130B.tar -C /usr/local/pdk/sky130B .
pv /tmp/sky130B.tar | xz > /tmp/sky130B.tar.xz
- name: Upload artifact
if: ${{ env.EXISTS == '0' }}
run: |
go get -u github.com/tcnksm/ghr
export PATH=$PATH:$(go env GOPATH)/bin
ghr\
-u ${{ env.OWNER }}\
-r ${{ env.REPO }}\
-t ${{ github.token }}\
-b "Automated release at $(date -u)"\
${{ env.TAG_NAME }}\
/tmp/sky130A.tar.xz
ghr\
-u ${{ env.OWNER }}\
-r ${{ env.REPO }}\
-t ${{ github.token }}\
-b "Automated release at $(date -u)"\
${{ env.TAG_NAME }}\
/tmp/sky130B.tar.xz