-
-
Notifications
You must be signed in to change notification settings - Fork 9
43 lines (41 loc) · 1.09 KB
/
relase.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
name: Release
on:
push:
tags:
- 'v*.*.*'
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
permissions:
contents: write
strategy:
matrix:
build:
- x86_64-unknown-linux-gnu
include:
- build: x86_64-unknown-linux-gnu
os: ubuntu-latest
target: x86_64-unknown-linux-gnu
steps:
- name: Read release tag
run: |
if [ "$GITHUB_EVENT_NAME" == 'workflow_dispatch' ]; then
echo "RELEASE_TAG=master" >> "$GITHUB_ENV"
else
echo "RELEASE_TAG=${GITHUB_REF#refs/tags/}" >> "$GITHUB_ENV"
fi
- name: Checkout
uses: actions/checkout@v3
- name: Build release
run: |
cargo build --release --target ${{ matrix.target }}
- name: Copy artifacts
working-directory: ./target/${{ matrix.target }}/release
run: |
mkdir -p "/tmp/artifacts"
tar cvzf "/tmp/artifacts/rmpc-${{ matrix.target }}.tar.gz" "rmpc"
- name: Release
uses: ncipollo/release-action@v1
with:
artifacts: /tmp/artifacts/*