-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmulti-platform.yml
More file actions
96 lines (84 loc) · 2.67 KB
/
multi-platform.yml
File metadata and controls
96 lines (84 loc) · 2.67 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
85
86
87
88
89
90
91
92
93
94
95
96
# Cross-platform builds for Linux, macOS, and Windows
name: Release
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'
permissions:
contents: write
jobs:
validate:
runs-on: ubuntu-22.04
timeout-minutes: 5
outputs:
version: ${{ steps.validate.outputs.version }}
steps:
- uses: actions/checkout@v4
- uses: michaelklishin/rust-build-package-release-action@v1
id: validate
with:
command: validate-version
- uses: michaelklishin/rust-build-package-release-action@v1
with:
command: extract-changelog
version: ${{ steps.validate.outputs.version }}
- uses: actions/upload-artifact@v4
with:
name: release-notes
path: release_notes.md
build:
needs: validate
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-22.04
- target: aarch64-unknown-linux-gnu
os: ubuntu-22.04
- target: aarch64-apple-darwin
os: macos-14
- target: x86_64-apple-darwin
os: macos-14
- target: x86_64-pc-windows-msvc
os: windows-2022
steps:
- uses: actions/checkout@v4
- run: rustup toolchain install stable --profile minimal
# The unified `release` command auto-selects the platform script from target
- uses: michaelklishin/rust-build-package-release-action@v1
id: build
with:
command: release
target: ${{ matrix.target }}
archive: 'true'
locked: 'true'
checksum: 'sha256,sha512'
# Upload both bare binary and archive (for pipeline compatibility)
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.target }}
path: |
${{ steps.build.outputs.bare_artifact_path }}
${{ steps.build.outputs.bare_artifact_path }}.sha256
${{ steps.build.outputs.artifact_path }}
${{ steps.build.outputs.artifact_path }}.sha256
${{ steps.build.outputs.artifact_path }}.sha512
release:
needs: [validate, build]
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- uses: actions/download-artifact@v4
with:
path: artifacts
- name: Collect files
run: |
mkdir -p release
find artifacts -type f \( -name "*.tar.gz" -o -name "*.zip" -o -name "*.sha256" -o -name "*.sha512" \) -exec cp {} release/ \;
- uses: softprops/action-gh-release@v2
with:
body_path: artifacts/release-notes/release_notes.md
files: release/*