-
Notifications
You must be signed in to change notification settings - Fork 1
107 lines (100 loc) · 2.77 KB
/
release.yml
File metadata and controls
107 lines (100 loc) · 2.77 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
97
98
99
100
101
102
103
104
105
106
107
# SPDX-FileCopyrightText: 2025 Adam Poulemanos <89049923+bashandbone@users.noreply.github.com>
#
# SPDX-License-Identifier: LicenseRef-PlainMIT OR MIT
name: Release
on:
push:
tags:
- "v*"
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
create-release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v6
- uses: taiki-e/create-gh-release-action@v1
if: github.event_name != 'workflow_dispatch'
with:
changelog: CHANGELOG.md
token: ${{ secrets.GITHUB_TOKEN }}
draft: true
build:
runs-on: ${{ matrix.os }}
needs: [create-release]
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- target: aarch64-apple-darwin
os: macos-latest
build-tool: cargo
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
build-tool: cross
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
build-tool: cross
- target: x86_64-pc-windows-msvc
os: windows-latest
build-tool: cargo
- target: aarch64-pc-windows-msvc
os: windows-latest
build-tool: cargo
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
fetch-tags: true
lfs: false
- uses: Swatinem/rust-cache@v2
with:
shared-key: rust-${{ matrix.target }}
- uses: taiki-e/upload-rust-binary-action@v1
with:
bin: submod
checksum: sha256
target: ${{ matrix.target }}
build-tool: ${{ matrix.build-tool }}
token: ${{ secrets.GITHUB_TOKEN }}
features: git2/vendored-libgit2,git2/vendored-openssl
dry-run: ${{ github.event_name == 'workflow_dispatch' }}
publish:
name: Publish to crates.io
needs: [build]
runs-on: ubuntu-latest
environment: cratesio
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
- uses: dtolnay/rust-toolchain@stable
- uses: rust-lang/crates-io-auth-action@v1
id: auth
- run: cargo publish --allow-dirty
env:
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
github_release:
name: Publish GitHub Release
needs: [build, publish]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v6
- name: Publish Release
uses: softprops/action-gh-release@v2
with:
body_path: CHANGELOG.md
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}