-
Notifications
You must be signed in to change notification settings - Fork 4
76 lines (70 loc) · 2.42 KB
/
release-kvx-elf.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
name: Release
on:
push:
tags:
- v*
jobs:
build:
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04, ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Install deps
run: ./install-ubuntu-prereq.sh
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Build
run: source last.refs && ./build-kvx-xgcc.sh gcc-kalray-kvx-${{ steps.get_version.outputs.VERSION }}
- name: Package
run: tar -cvzf gcc-kalray-kvx-${{ matrix.os }}-${{ steps.get_version.outputs.VERSION }}.tar.gz gcc-kalray-kvx-${{ steps.get_version.outputs.VERSION }}
- name: Upload toolchain
uses: actions/upload-artifact@v3
with:
name: toolchain-package-${{ matrix.os }}
path: ./gcc-kalray-kvx-${{ matrix.os }}-${{ steps.get_version.outputs.VERSION }}.tar.gz
release:
needs: build
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Check pre-release
id: get_prerelease
run: echo ::set-output name=PRERELEASE::$([[ $GITHUB_REF =~ .*-cd.* ]] && echo "true" || echo "false")
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: ${{ steps.get_prerelease.outputs.PRERELEASE }}
deploy:
needs: release
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
runs-on: ${{ matrix.os }}
steps:
- name: Download toolchain from build
uses: actions/download-artifact@v3
with:
name: toolchain-package-${{ matrix.os }}
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Upload Release Asset
id: upload-release-asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: gcc-kalray-kvx-${{ matrix.os }}-${{ steps.get_version.outputs.VERSION }}.tar.gz
asset_name: gcc-kalray-kvx-${{ matrix.os }}-${{ steps.get_version.outputs.VERSION }}.tar.gz
asset_content_type: application/gzip