-
Notifications
You must be signed in to change notification settings - Fork 35
56 lines (49 loc) · 1.49 KB
/
build-calendars.yaml
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
name: Build Calendars
on:
pull_request:
branches: [ "main" ]
paths:
- 'manually_specified.yaml'
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
RUST_LOG: trace
jobs:
build-calendars:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
~/.cargo
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Cargo build
uses: actions-rs/cargo@v1
with:
command: build
args: --release
- name: Cargo run
uses: actions-rs/cargo@v1
with:
command: run
# Don't actually compile the calendars, only check
# manually_specified.yaml for conflicts & errors
args: --release -- --only-check-for-overlaps=true
- name: Update draft release with build artefacts
uses: beyarkay/update-existing-release@master
continue-on-error: true # this step fails on PRs originating from a FORK
with:
token: ${{ secrets.GH_ACTIONS_PAT || github.token }}
release: Draft release with build artefacts
updateTag: true
tag: builds
replace: true
files: calendars/calendar_preview.png
body: |
This release contains build artefacts. If you want to add load
shedding to your calendar, click
[here](https://github.com/beyarkay/eskom-calendar/releases/tag/latest).