-
Notifications
You must be signed in to change notification settings - Fork 0
116 lines (101 loc) · 2.88 KB
/
flow.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
name: Suite
on:
push:
branches:
- root
tags:
- v*
pull_request: {}
env:
RELEASE: true
CHECK: true
PREREQS: true
jobs:
ci:
name: CI - ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-20.04
- windows-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cargo cache restore
id: cargo-cache
uses: actions/cache@v2
with:
path: |
~/.cargo
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: Pip cache restore
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-${{ hashFiles('**/requirements.txt') }}
- name: Install scoop
id: scoop
if: matrix.os == 'windows-latest'
run: |
Set-ExecutionPolicy RemoteSigned -scope CurrentUser
Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
echo "::add-path::~/scoop/shims"
Write-Output "Installing prerequisites."
scoop install rustup busybox make gawk jq
shell: powershell
- name: Run CI make task
run: make --trace ci
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: junctor
path: target/thumbv7em-none-eabihf/release/junctor
- name: Upload artifact
if: matrix.os == 'ubuntu-20.04'
uses: actions/upload-artifact@v2
with:
name: CHANGELOG.md
path: CHANGELOG.md
releaser:
name: Release
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-20.04
needs: ci
steps:
- name: Download junctor
uses: actions/download-artifact@v2
with:
name: junctor
path: junctor
- name: Download CHANGELOG.md
uses: actions/download-artifact@v2
with:
name: CHANGELOG.md
path: CHANGELOG.md
- name: Cut a release if needed
id: cut_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body_path: CHANGELOG.md
draft: true
prerelease: false
- name: Upload release if needed
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.cut_release.outputs.upload_url }}
asset_path: junctor
asset_name: junctor
asset_content_type: application/octet-stream