@@ -4,6 +4,15 @@ on: [push, pull_request]
44
55jobs :
66
7+ release-notice :
8+ name : This is a release build
9+ if : startsWith(github.ref, 'refs/tags/v')
10+ runs-on : ubuntu-latest
11+
12+ steps :
13+ - name : Show version
14+ run : echo "This is a release build for v${GITHUB_REF/refs\/tags\/v/}"
15+
716 build :
817 strategy :
918 matrix :
7887 with :
7988 name : ${{ matrix.crate }}-${{ matrix.target }}
8089 path : ${{ matrix.crate }}-${{ matrix.target }}
90+
91+ release :
92+ name : Release
93+ if : startsWith(github.ref, 'refs/tags/v')
94+ runs-on : ubuntu-latest
95+ needs : build
96+
97+ steps :
98+ - name : Get version
99+ id : v
100+ run : |
101+ echo ::set-output name=v::${GITHUB_REF/refs\/tags\/v/}
102+ echo "Version is v${GITHUB_REF/refs\/tags\/v/}"
103+ - uses : actions/checkout@v1
104+ - name : Check release notes exist
105+ run : |
106+ if [ -f release_notes/v${{ steps.v.outputs.v }}.md ]
107+ then
108+ echo "Release notes found at release_notes/v${{ steps.v.outputs.v }}.md"
109+ else
110+ echo "Release notes not found at release_notes/v${{ steps.v.outputs.v }}.md"
111+ exit 1
112+ fi
113+ - name : Get vhdl_lang linux
114+ uses : actions/download-artifact@v1
115+ with :
116+ name : vhdl_lang-x86_64-unknown-linux-gnu
117+ - name : Check vhdl_lang version
118+ run : |
119+ chmod u+x vhdl_lang-x86_64-unknown-linux-gnu/bin/vhdl_lang
120+ version_string=$(vhdl_lang-x86_64-unknown-linux-gnu/bin/vhdl_lang --version)
121+ if [ "$version_string" != "vhdl_lang ${{ steps.v.outputs.v }}" ]
122+ then
123+ echo "Version string mismatch (\"$version_string\" != \"vhdl_lang ${{ steps.v.outputs.v }}\""
124+ exit 1
125+ else
126+ echo "Version string matched"
127+ fi
128+ - name : Get vhdl_ls linux
129+ uses : actions/download-artifact@v1
130+ with :
131+ name : vhdl_ls-x86_64-unknown-linux-gnu
132+ - name : Check vhdl_ls version
133+ run : |
134+ chmod u+x vhdl_ls-x86_64-unknown-linux-gnu/bin/vhdl_ls
135+ version_string=$(vhdl_ls-x86_64-unknown-linux-gnu/bin/vhdl_ls --version)
136+ if [ "$version_string" != "vhdl_ls ${{ steps.v.outputs.v }}" ]
137+ then
138+ echo "Version string mismatch (\"$version_string\" != \"vhdl_lang ${{ steps.v.outputs.v }}\""
139+ exit 1
140+ else
141+ echo "Version string matched"
142+ fi
143+ - name : Get vhdl_lang windows
144+ uses : actions/download-artifact@v1
145+ with :
146+ name : vhdl_lang-x86_64-pc-windows-msvc
147+ - name : Get vhdl_ls windows
148+ uses : actions/download-artifact@v1
149+ with :
150+ name : vhdl_ls-x86_64-pc-windows-msvc
151+ - name : Zip artifacts
152+ run : |
153+ zip -r vhdl_lang-x86_64-unknown-linux-gnu.zip vhdl_lang-x86_64-unknown-linux-gnu
154+ zip -r vhdl_ls-x86_64-unknown-linux-gnu.zip vhdl_ls-x86_64-unknown-linux-gnu
155+ zip -r vhdl_lang-x86_64-pc-windows-msvc.zip vhdl_lang-x86_64-pc-windows-msvc
156+ zip -r vhdl_ls-x86_64-pc-windows-msvc.zip vhdl_ls-x86_64-pc-windows-msvc
157+ - name : Do release
158+ uses : ncipollo/release-action@v1
159+ with :
160+ draft : false
161+ artifacts : " vhdl_lang-x86_64-unknown-linux-gnu.zip,vhdl_ls-x86_64-unknown-linux-gnu.zip,vhdl_lang-x86_64-pc-windows-msvc.zip,vhdl_ls-x86_64-pc-windows-msvc.zip"
162+ bodyFile : " release_notes/v${{ steps.v.outputs.v }}.md"
163+ token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments