-
Notifications
You must be signed in to change notification settings - Fork 3
139 lines (133 loc) · 4.49 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
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
name: Release
on:
push:
tags:
- '*'
jobs:
create-release:
name: create-release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.release.outputs.upload_url }}
ff_utils_version: ${{ env.FF_UTILS_VERSION }}
steps:
- name: Get release version
run: |
echo "FF_UTILS_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
echo "tag: ${{ env.TAG_NAME }}"
- uses: actions/[email protected]
id: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: true
prerelease: false
release-linux:
needs: ['create-release']
runs-on: ubuntu-latest
strategy:
matrix:
target:
- aarch64-unknown-linux-gnu
- aarch64-unknown-linux-musl
- x86_64-unknown-linux-gnu
- x86_64-unknown-linux-musl
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --release --target=${{ matrix.target }}
- name: Create release archive
id: create_archive
run: |
ARCHIVE=finalfusion-${{ needs.create-release.outputs.ff_utils_version }}-${{ matrix.target }}.tar.gz
tar -czvf ${ARCHIVE} -C target/${{ matrix.target }}/release finalfusion
echo ::set-output name=ASSET::$ARCHIVE
- uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: ${{ steps.create_archive.outputs.ASSET }}
asset_name: ${{ steps.create_archive.outputs.ASSET }}
asset_content_type: application/gzip
release-linux-mkl:
needs: ['create-release']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --target=x86_64-unknown-linux-gnu --release --features intel-mkl
- name: Create release archive
id: create_archive
run: |
ARCHIVE=finalfusion-${{ needs.create-release.outputs.ff_utils_version }}-x86_64-unknown-linux-gnu-mkl.tar.gz
strip target/x86_64-unknown-linux-gnu/release/finalfusion
tar -czvf ${ARCHIVE} -C target/x86_64-unknown-linux-gnu/release finalfusion
echo ::set-output name=ASSET::$ARCHIVE
- uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: ${{ steps.create_archive.outputs.ASSET }}
asset_name: ${{ steps.create_archive.outputs.ASSET }}
asset_content_type: application/gzip
release-mac:
needs: ['create-release']
runs-on: macos-latest
steps:
- uses: actions/checkout@v1
- name: Remove command-line tools
run: |
sudo rm -rf /Library/Developer/CommandLineTools/SDKs/*
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: aarch64-apple-darwin
override: true
- uses: actions-rs/cargo@v1
with:
command: build
args: --release --target=x86_64-apple-darwin --features accelerate
- uses: actions-rs/cargo@v1
with:
command: build
args: --release --target=aarch64-apple-darwin --features accelerate
- name: Create universal binary
run: |
lipo -create -output finalfusion \
target/aarch64-apple-darwin/release/finalfusion \
target/x86_64-apple-darwin/release/finalfusion
- name: Create release archive
id: create_archive
run: |
ARCHIVE=finalfusion-${{ needs.create-release.outputs.ff_utils_version }}-universal-macos.tar.gz
strip finalfusion
tar -czvf ${ARCHIVE} finalfusion
echo ::set-output name=ASSET::$ARCHIVE
- uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: ${{ steps.create_archive.outputs.ASSET }}
asset_name: ${{ steps.create_archive.outputs.ASSET }}
asset_content_type: application/gzip