-
Notifications
You must be signed in to change notification settings - Fork 94
90 lines (77 loc) · 2.54 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
on:
push:
branches: [ master ]
tags:
- '*'
env:
CARGO_TERM_COLOR: always
jobs:
build_release:
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-20.04
- target: x86_64-apple-darwin
os: macos-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install -y libudev-dev
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
components: rustfmt, clippy
- name: cargo build --release
uses: actions-rs/cargo@v1
with:
command: build
args: --release
- run: |
mv target/release/solana-stake-o-matic solana-stake-o-matic-${{ matrix.target }}
mv target/release/solana-foundation-delegation-program solana-foundation-delegation-program-${{ matrix.target }}
- uses: actions/upload-artifact@v2
with:
name: ${{ matrix.target }}
path: |
solana-stake-o-matic-${{ matrix.target }}
solana-foundation-delegation-program-${{ matrix.target }}
if-no-files-found: error
publish_release:
needs: build_release
runs-on: ubuntu-20.04
steps:
- uses: actions/download-artifact@v2
- if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: |
x86_64-apple-darwin/solana-stake-o-matic-x86_64-apple-darwin
x86_64-unknown-linux-gnu/solana-stake-o-matic-x86_64-unknown-linux-gnu
x86_64-apple-darwin/solana-foundation-delegation-program-x86_64-apple-darwin
x86_64-unknown-linux-gnu/solana-foundation-delegation-program-x86_64-unknown-linux-gnu
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- if: startsWith(github.ref, 'refs/heads/master')
run: |
set -x
mkdir master-bin
mv x86_64-apple-darwin/* master-bin/
mv x86_64-unknown-linux-gnu/* master-bin/
cd master-bin
git init .
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add *
git commit -m "Build artifacts from $GITHUB_SHA" --allow-empty
- if: startsWith(github.ref, 'refs/heads/master')
uses: ad-m/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: master-bin
directory: master-bin
force: true