-
Notifications
You must be signed in to change notification settings - Fork 12
66 lines (53 loc) · 1.7 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
name: Release
on:
release:
types: [published]
workflow_dispatch:
inputs:
tag:
description: "tag"
required: true
jobs:
publish:
runs-on: ubuntu-22.04
timeout-minutes: 35
steps:
- name: Set tag
if: ${{ github.event.release }}
run: echo "RELEASE_TAG=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
- name: Set tag
if: ${{ github.event.inputs.tag }}
run: echo "RELEASE_TAG=${{ github.event.inputs.tag }}" >> $GITHUB_ENV
- uses: actions/checkout@v3
- uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
default: true
- uses: actions-rs/cargo@v1
with:
command: build
args: --release --all-features
- name: Create release archive
env:
GH_TOKEN: ${{ github.token }}
run: |
mkdir release-${RELEASE_TAG}-assets
cp target/release/rikctl release-${RELEASE_TAG}-assets/
cp target/release/riklet release-${RELEASE_TAG}-assets/
cp target/release/scheduler release-${RELEASE_TAG}-assets/
cp target/release/controller release-${RELEASE_TAG}-assets/
cp README.md release-${RELEASE_TAG}-assets/
cp LICENSE release-${RELEASE_TAG}-assets/
tar -czvf rik-$RELEASE_TAG-x86_64.tar.gz \
-C release-${RELEASE_TAG}-assets/ \
rikctl \
riklet \
scheduler \
controller \
README.md \
LICENSE
gh release upload $RELEASE_TAG rik-$RELEASE_TAG-x86_64.tar.gz