Skip to content

Commit ab484f5

Browse files
committed
Feat: Github Actions CI release workflow
1 parent fa48108 commit ab484f5

1 file changed

Lines changed: 55 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: release
2+
3+
on:
4+
push:
5+
branches: [ $default-branch ]
6+
workflow_dispatch:
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v2
14+
15+
- name: Checkout submodules
16+
run: git submodule update --init --recursive
17+
18+
- name: Install FPGA toolchain
19+
uses: YosysHQ/setup-oss-cad-suite@v1
20+
21+
#- name: Install RISC-V toolchain
22+
#run: |
23+
#wget https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack/releases/download/v10.1.0-1.1/xpack-riscv-none-embed-gcc-10.1.0-1.1-linux-x64.tar.gz
24+
#tar -xf xpack-riscv-none-embed-gcc-10.1.0-1.1-linux-x64.tar.gz
25+
#rm xpack-riscv-none-embed-gcc-10.1.0-1.1-linux-x64.tar.gz
26+
#echo "$(pwd)/xpack-riscv-none-embed-gcc-10.1.0-1.1/bin" >> $GITHUB_PATH
27+
28+
- name: Set Env Vars
29+
run: |
30+
echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
31+
echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV
32+
echo ${{ env.SHORT_SHA }}
33+
echo ${{ env.DATE }}
34+
35+
- name: Run gateware build
36+
run: |
37+
make -j$(nproc)
38+
mv "build/icesid.bin" "build/icesid-${{ env.DATE }}-${{ env.SHORT_SHA }}.bin"
39+
40+
- name: Build artifact upload
41+
uses: actions/upload-artifact@v2
42+
with:
43+
name: icesid-build
44+
path: build/icesid*.bin
45+
46+
- name: Release (as draft)
47+
uses: softprops/action-gh-release@v1
48+
with:
49+
name: Release ${{ env.DATE }}-${{ env.SHORT_SHA }}
50+
tag_name: ${{ env.DATE }}-${{ env.SHORT_SHA }}
51+
draft: true
52+
files: |
53+
build/icesid*.bin
54+
env:
55+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)