Repository navigation
91 lines (79 loc) · 2.69 KB
/
Copy pathrelease.yml
File metadata and controls
91 lines (79 loc) · 2.69 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
# SPDX-License-Identifier: MPL-2.0 OR AGPL-3.0-or-later
name: Release
on:
push:
tags:
- 'v*'
permissions: read-all
env:
CARGO_TERM_COLOR: always
jobs:
create-release:
name: Create Release
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: write
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Create Release
id: create_release
uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3
with:
generate_release_notes: true
draft: false
prerelease: false
build-release:
name: Build Release
needs: create-release
runs-on: ${{ matrix.os }}
timeout-minutes: 15
permissions:
contents: write
id-token: write
attestations: write
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
artifact_name: fslint
asset_name: fslint-linux-amd64
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
artifact_name: fslint
asset_name: fslint-linux-arm64
- os: windows-latest
target: x86_64-pc-windows-msvc
artifact_name: fslint.exe
asset_name: fslint-windows-amd64.exe
- os: macos-latest
target: x86_64-apple-darwin
artifact_name: fslint
asset_name: fslint-macos-amd64
- os: macos-latest
target: aarch64-apple-darwin
artifact_name: fslint
asset_name: fslint-macos-arm64
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install Rust
uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # v1
with:
toolchain: stable
targets: ${{ matrix.target }}
- name: Build release binary
run: cargo build --release --target ${{ matrix.target }}
- name: Strip binary (Linux/macOS)
if: matrix.os != 'windows-latest'
run: strip target/${{ matrix.target }}/release/${{ matrix.artifact_name }}
- name: Upload Release Asset
uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3
with:
files: ./target/${{ matrix.target }}/release/${{ matrix.artifact_name }}
- name: Attest build provenance
uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2
with:
subject-path: ./target/${{ matrix.target }}/release/${{ matrix.artifact_name }}