-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathrelease-mist.yml
85 lines (85 loc) · 4.41 KB
/
release-mist.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
82
83
84
85
################################################################################
# SPDX-License-Identifier: CC0-1.0
# SPDX-FileType: OTHER
# SPDX-FileCopyrightText: (c) 2021-2022, The Raetro authors and contributors
################################################################################
name: Compile New Core for MiST
################################################################################
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- '*' # Trigger only on tags. i.e. 211231
################################################################################
jobs:
synthesis:
runs-on: ubuntu-latest
############################################################################
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
############################################################################
steps:
##########################################################################
## 1 - Checkout repository
##########################################################################
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: recursive # Required to fetch the mist-modules
##########################################################################
## 2 - RTL synthesis
##########################################################################
- name: Run compilation flow
run: docker run --rm -v ${{ github.workspace }}:/build raetro/quartus:13.1 quartus_sh --flow compile menu.qpf
##########################################################################
## 3 - Get current version for tagging binary
##########################################################################
- name: Get the version
id: version
run: echo ::set-output name=version::${GITHUB_REF#refs/tags/} # Get the version from the tag
#run: echo "::set-output name=version::$(date +'%Y%m%d')" # Use date as version
##########################################################################
## 4 - Upload artifacts
##########################################################################
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: OutputFiles_${{ steps.version.outputs.version }}
path: output_files/
retention-days: 14
##########################################################################
## 5 - Create tag with version and SHA256 checksum
##########################################################################
- name: Create a copy and tag with version
run: |
mkdir -p release
cp output_files/menu.rbf release/menu_${{ steps.version.outputs.version }}.rbf
sha256sum output_files/menu.rbf > release/menu_${{ steps.version.outputs.version }}.rbf.sha256
##########################################################################
## 6 - Create a new GitHub release and upload the distribution artifacts
##########################################################################
- name: Create a new GitHub release
uses: softprops/action-gh-release@v0.1.14
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
output_files/menu.sof
release/menu_${{ steps.version.outputs.version }}.rbf
release/menu_${{ steps.version.outputs.version }}.rbf.sha256
##########################################################################
## 7 - Don't ever commit binary files to Git!
## "Source files" It easily lets you see textual changes.
## But this function is useless for binary data also
## Git doesn't compress binary files, and because repos have all the
## history, committing binary files means permanent bloat.
## But if this is what you want to do. Here's how to do it.
##########################################################################
#- name: Commit Binary to Repository (aka. the MiST(er) way)
# run: |
# git fetch
# git checkout -b master
# git config user.name github-actions
# git config user.email github-actions@github.com
# git add release/menu_${{ steps.version.outputs.version }}.rbf
# git commit -m "Release ${{ steps.version.outputs.version }}"
# git push origin master