-
Notifications
You must be signed in to change notification settings - Fork 1
84 lines (75 loc) · 2.15 KB
/
release.yaml
File metadata and controls
84 lines (75 loc) · 2.15 KB
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
name: Build and Release
on:
workflow_dispatch:
jobs:
get-data:
name: Read Cargo TOML
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@master
- name: Read Cargo TOML
uses: SebRollen/toml-action@v1.2.0
id: read_toml
with:
file: "./base/Cargo.toml"
field: "package.version"
outputs:
base_version: ${{ steps.read_toml.outputs.value }}
draft-release:
name: Create a draft release
runs-on: ubuntu-latest
needs: get-data
permissions:
contents: write
steps:
- name: Push Tag
id: tag_version
uses: mathieudutour/github-tag-action@v6.2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: ${{ needs.get-data.outputs.base_version }}
- name: Create Release
uses: ncipollo/release-action@v1.16.0
with:
draft: true
tag: ${{ steps.tag_version.outputs.new_tag }}
name: Release ${{ steps.tag_version.outputs.new_tag }}
outputs:
tag: ${{ steps.tag_version.outputs.new_tag }}
build:
name: Build and Upload
needs: draft-release
permissions:
contents: write
strategy:
matrix:
include:
- target: x86_64-pc-windows-gnu
runs-on: windows-latest
artifact_name: module.dll
folder: module
runs-on: ${{ matrix.runs-on }}
steps:
- name: Checkout
uses: actions/checkout@main
with:
submodules: true
- name: Cross build binary
uses: houseabsolute/actions-rust-cross@v1
with:
command: build
toolchain: stable
target: ${{ matrix.target }}
args: "--locked --release"
strip: true
- name: Upload release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/${{ matrix.target }}/release/${{ matrix.artifact_name }}
asset_name: ${{ matrix.artifact_name }}
tag: ${{ needs.draft-release.outputs.tag }}
overwrite: true