-
Notifications
You must be signed in to change notification settings - Fork 18
60 lines (56 loc) · 1.61 KB
/
automated_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
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
name: Automated Release
permissions:
contents: write
env:
CARGO_TERM_COLOR: always
jobs:
release:
name: build-release-assets
runs-on: ubuntu-20.04
steps:
# Setup Rust Environment
- name: setup-rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
# Checkout repository code
- name: checkout-code
uses: actions/checkout@v2
- name: "Check version"
run: scripts/check_version.sh
# Rust Cache
- name: rust-cache
uses: actions/cache@v3
id: rust-cache
with:
path: |
~/.cargo/bin
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
target
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
# Install OpenSSL dependencies
- name: install-packages
run: sudo apt-get install -y libssl-dev musl-tools
# Build Rust Artifacts
- name: build-rust
run: |
rustup target add x86_64-unknown-linux-musl
cargo build --target x86_64-unknown-linux-musl --release --all
# Create Release and Upload artifacts
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
target/x86_64-unknown-linux-musl/release/steward
LICENSE
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}