-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (37 loc) · 1.27 KB
/
release.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
# shoutout @wermipls
name: build + release
on:
push:
tags: [ "*.*.*" ]
jobs:
windows:
if: startsWith(github.ref, 'refs/tags/')
runs-on: windows-latest
defaults:
run:
shell: pwsh
steps:
- uses: actions/checkout@v4
- name: get current project version
run: |
# Not working
# $project_version = cargo metadata --format-version 1 2> $null | jq -r '.packages[] | select(.name == "cascade_cli").version'
#
# I give up
#
# This is disgusting - need to assume nothing else in Cargo.toml has
# "version = x.x.x" from start of line
$project_version = cat .\cascade_app\Cargo.toml | grep -oE '^version = \"?[0-9]+\.[0-9]+\.[0-9]+\"' | grep -oE "[0-9]+\.[0-9]+\.[0-9]+"
"project_version=$project_version" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: install nightly rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
- name: cargo build
run: cargo build --release
- name: create release
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
# Probably a better way to do this
files: ./target/release/cascade.exe