-
Notifications
You must be signed in to change notification settings - Fork 13
55 lines (53 loc) · 2.21 KB
/
release.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
name: Release
on:
push:
tags:
- '*'
jobs:
Build:
uses: ./.github/workflows/ci.yml
Release:
strategy:
matrix:
architecture: [X64, ARM64]
distribution: [Ubuntu]
runs-on:
- self-hosted
- Linux
- ${{matrix.architecture}}
needs:
- Build
steps:
- name: Tar X64 artifacts # Below workaround will allow files to be extracted to a directory e.g. aperf-v0.1-x86_64/
if: ${{ matrix.architecture == 'X64' }}
run: sudo mkdir -p aperf-${{ github.ref_name }}-x86_64 && sudo cp ./target/x86_64-unknown-linux-musl/release/aperf ./aperf-${{ github.ref_name }}-x86_64 && sudo tar -cvzf aperf-${{ github.ref_name }}-x86_64.tar.gz aperf-${{ github.ref_name }}-x86_64/ && sudo rm -rf aperf-${{ github.ref_name }}-x86_64
- name: Tar ARM64 artifacts
if: ${{ matrix.architecture == 'ARM64' }}
run: sudo mkdir -p aperf-${{ github.ref_name }}-aarch64 && sudo cp ./target/aarch64-unknown-linux-musl/release/aperf ./aperf-${{ github.ref_name }}-aarch64 && sudo tar -cvzf aperf-${{ github.ref_name }}-aarch64.tar.gz aperf-${{ github.ref_name }}-aarch64/ && sudo rm -rf aperf-${{ github.ref_name }}-aarch64
- name: Create Release
if: github.run_number == 1
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: APerf-${{ github.ref }}
draft: false
prerelease: false
- name: Upload X64 artifacts.
if: ${{ matrix.architecture == 'X64' }}
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./aperf-${{ github.ref_name }}-x86_64.tar.gz
tag: ${{ github.ref }}
asset_name: aperf-${{ github.ref_name }}-x86_64.tar.gz
- name: Upload ARM64 artifacts
if: ${{ matrix.architecture == 'ARM64' }}
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./aperf-${{ github.ref_name }}-aarch64.tar.gz
tag: ${{ github.ref }}
asset_name: aperf-${{ github.ref_name }}-aarch64.tar.gz